首页 > 解决方案 > 迁移到 Androidx 后,butterknife 不起作用

问题描述

- 将我的 android 项目迁移到 Androidx 后,我收到此错误:

ERROR: Failed to resolve: core
Affected Modules: app

- 重建后我得到这个:

Could not find core.jar (androidx.core:core:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/core/core/1.0.0/core-1.0.0.jar

- 但是在从我的 gradle 中排除黄油刀之后,一切都变得很好,我没有收到任何错误。

- 我以前试过这个但没有用:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

-我在 gradle.properties 中使用了以下代码

android.enableJetifier=true
android.useAndroidX=true

-butterknife 依赖代码:

implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'

标签: android-studioandroidxbutterknife

解决方案


推荐阅读