【问题标题】:Android studio 3.0 : error occur while compiling appAndroid studio 3.0:编译应用程序时发生错误
【发布时间】:2017-11-03 10:35:20
【问题描述】:

编译安卓应用时出错。

Execution failed for task ':app:javaPreCompileDebug'
The following dependencies on the compile classpath are found to contain annotation processor.Please add them to the annotationProcessor configuration.
- butterknife-5.1.2.jar (butterknife-5.1.2.jar)

【问题讨论】:

    标签: android android-gradle-plugin butterknife android-studio-3.0


    【解决方案1】:

    不要使用 5.1.2 jar。而是在 gradle 中使用这个最新版本,并使用注解使其工作。

    dependencies {
        compile 'com.jakewharton:butterknife:8.8.1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    }
    

    【讨论】:

      【解决方案2】:

      尝试添加此库的最新版本。并且不要忘记在依赖项中添加 annotationProcessor:

      compile 'com.jakewharton:butterknife:8.8.1'
      annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
      

      【讨论】:

        【解决方案3】:

        在您的应用程序 gradle 中添加以下行

         compile 'com.jakewharton:butterknife:8.8.1'
         annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
        

        然后在你的类中使用 BindView 而不是 Bind。

        【讨论】:

          猜你喜欢
          • 2018-05-03
          • 1970-01-01
          • 1970-01-01
          • 2018-11-06
          • 2023-03-30
          • 1970-01-01
          • 1970-01-01
          • 2018-04-06
          • 1970-01-01
          相关资源
          最近更新 更多