android-studio - 迁移到 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'
解决方案
推荐阅读
- post - 从 Shopify 发送获取请求
- android - Android Studio Gradle 中的 Apache Commons?
- swift - 设备方向更改后在 collectionViewCell 内使 CAShapeLayer 无效并重绘
- php - 刀片功能,因此用户不会在 laravel 中跟随自己
- vbscript - HP UFT 错误:需要对象:“浏览器”
- symfony - Sonata Admin 视图中自定义列上的 Concat 字段
- javascript - 使用 JS 覆盖类的样式,以便更改可以在该类的所有元素上可见
- vue.js - 获取随机哈希而不是图像 url
- jquery - Ajax 调用不更新链接到 ASP.NET MVC 网页的 SQL Server 数据库
- reactjs - 使用 JSS/Material-UI 传递样式选项