ButterKnife 安装坑

2019-05-05  本文已影响0人  y2015

安装最新 10.1.0 同步后报错为
ButterKnife Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91。。。

安装8.8.0 同步报错为:
Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.g。。。。。

最后修改为9.0.0 编译成功

安装步骤:

  1. build.gradle(project)
android {
  ...
  // Butterknife requires Java 8.
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

dependencies {
  implementation 'com.jakewharton:butterknife:10.1.0'
  annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
}
  1. build.gradle(app)
buildscript {
  repositories {
    mavenCentral()
    google()
   }
  dependencies {
    classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0'
  }
}

3、build.gradle(app)

apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
上一篇 下一篇

猜你喜欢

热点阅读