这篇文章上次修改于 2141 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

android kotlin 报错:Failed to transform artifact ‘butterknife-runtime.aar,这个是因为kotlin引入butterknife的方式不一样

正确写法

   kapt  'com.jakewharton:butterknife-compiler:10.1.0'

完整报错:

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform artifact 'butterknife-runtime.aar (com.jakewharton:butterknife-runtime:10.1.0)' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=15}
      > Execution failed for DexingTransform: /home/shenfeng/.gradle/caches/transforms-2/files-2.1/24f8d04ecd88af554a48c2075e2142f3/jars/classes.jar.
         > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org