我想升级 Google 图书馆:
build.gradle(应用程序):
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
// Here an error appears.
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
implementation "com.android.support:support-v4:${supportLibraryVersion}"
implementation "com.android.support:design:${supportLibraryVersion}"
implementation "com.android.support:support-vector-drawable:${supportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:support-compat:${supportLibraryVersion}"
// These libraries are updated.
// Google Maps.
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation "com.google.firebase:firebase-messaging:19.0.1"
implementation "com.google.android.gms:play-services-base:17.0.0"
// Firebase.
implementation 'com.google.firebase:firebase-config:18.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
// Multidex.
implementation 'com.android.support:multidex:1.0.3'
}
Run Code Online (Sandbox Code Playgroud)
build.gradle(项目):
buildscript {
ext.compile_sdk_version = 29
ext.min_sdk_version = 16
ext.target_sdk_version = 29
ext.kotlin_version = '1.3.40'
ext.supportLibraryVersion = "28.0.0"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Firebase.
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
我在第一个支持库中遇到错误。我没有 AndroidX,只有 28.0.0。更新任何 Google 库都会导致此错误(Google Maps 或 Firebase)。
使用 groupId com.android.support 和 androidx.* 的依赖不能组合,但是发现 IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='loader', myVersion='28.0.0', myPacking='aar', myClassifier='null'} 和 IdeMavenCoordinates{myGroupId='androidx.versionedparcelable', myArtifactId='versionedparcelable', myVersion='1.0.0', myPacking='aar', myClassifier='null'} 不兼容的依赖项
检查信息:存在一些不兼容或可能导致错误的库或工具和库的组合。一种此类不兼容性是使用非最新版本的 Android 支持库版本(或者特别是低于您的 targetSdkVersion 的版本)进行编译。问题 ID:GradleCompatible
我看到我可以使用对 Androidx 项目使用 android 支持的库。,依赖项有问题和错误,https://github.com/react-native-community/async-storage/issues/128。
编译项目后,我在“构建输出”中收到android:supportsRtl="true":
任务 :app:processDebugManifest 失败
C:\Users\ ...\AndroidStudioProjects\ ...\app\src\main\AndroidManifest.xml:22:18-91 错误:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 也出现在 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value= (androidx.core.app.CoreComponentFactory)。建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:15:5-145:19 的元素以覆盖。
当我<application>在 AndroidManifest 中添加标签时,tools:replace="android:appComponentFactory"我收到另一个错误:
工具:替换在第 15 行为属性 android:appComponentFactory 指定,但未指定新值
C:\Users\ ...\AndroidStudioProjects\ ...\app\src\main\AndroidManifest.xml 错误:验证失败,退出
(如在Android X 中:tools:replace 在 line: for 属性中指定,但没有指定新值)。
我应该将应用程序迁移到 AndroidX 吗?
| 归档时间: |
|
| 查看次数: |
7747 次 |
| 最近记录: |