gpt4 book ai didi

java - 安卓工作室错误 : "Android resource linking failed. error: failed linking references" with google services API

转载 作者:行者123 更新时间:2023-11-30 04:57:44 26 4
gpt4 key购买 nike

您好,我正在尝试将此 google play 服务:com.google.android.gms:play-services-vision:18.0.0 添加到我的应用程序中,但它给了我这个错误:

Android resource linking failed
Output: /home/user/java/Project/android-storage-permissions-master/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:460: error: resource android:attr/fontVariationSettings not found.
/home/user/java/Project/android-storage-permissions-master/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:460: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: /home/user/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-linux.jar/9bc4b7764b45753075ab29399a857b9f/aapt2-3.2.0-4818971-linux/aapt2 link -I\
/home/user/Android/Sdk/platforms/android-27/android.jar\
--manifest\
/home/user/java/Project/android-storage-permissions-master/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/home/user/java/Project/android-storage-permissions-master/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
@/home/user/java/Project/android-storage-permissions-master/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/home/user/java/Project/android-storage-permissions-master/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.google.samples.dataprivacy\
-0\
apk\
--output-text-symbols\
/home/user/java/Project/android-storage-permissions-master/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.0-4818971-linux Daemon #0

这些是我的 build.gradle(Module.App) 依赖项:

dependencies {
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"
implementation "com.android.support:design:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:support-core-utils:$rootProject.ext.supportLibraryVersion"
implementation "com.google.android.gms:play-services-vision:18.0.0"
implementation "pub.devrel:easypermissions:$rootProject.ext.easypermissionsVersion"

androidTestImplementation("com.android.support.test.espresso:espresso-core:$rootProject.ext.espressoVersion", {
exclude group: "com.android.support", module: "support-annotations"
})

// Dependencies for local unit tests
testImplementation "junit:junit:$rootProject.ext.junitVersion"
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testImplementation "org.hamcrest:hamcrest-all:$rootProject.ext.hamcrestVersion"
testImplementation "org.powermock:powermock-module-junit4:$rootProject.ext.powerMockito"
testImplementation "org.powermock:powermock-api-mockito:$rootProject.ext.powerMockito"
testImplementation "junit:junit:$rootProject.ext.junitVersion"

}

在顶级 gradle 文件中,我使用的是 supportLibraryVersion = '27.1.1'。我试图将编译 sdk 版本更改为 v28,但它给了我其他错误,因为我的代码的许多其他部分都是为 v27 编写的。现在我使用 com.google.android.gms:play-services-vision:17.0.2 解决了它。我想知道是否有其他方法可以修复此错误,请继续使用更新版本的 API。

最佳答案

这是因为该库中使用的属性仅在 API 28 中添加。获取 fontVariationSettings 和 ttcIndex 的唯一方法是将您的编译 SDK 版本升级到 28。另一种选择是降级该库的版本。

关于java - 安卓工作室错误 : "Android resource linking failed. error: failed linking references" with google services API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58838838/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com