Android Studio错误:带有Google Services API的“ Android资源链接失败。错误:链接引用失败”

时间:2019-11-13 14:01:54

标签: java android google-vision

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

SELECT Table1.[Room Type], 
        Count(IIf(Table1.Color="White",1,Null)) AS CountWhite, 
        Count(IIf(Table1.Color="Black",1,Null)) AS CountBlack, 
        IIf(CountWhite>CountBlack,"White",(IIf(CountBlack>CountWhite,"Black","Tie"))) AS Expr1
 FROM Table1
 GROUP BY Table1.[Room Type];

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

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

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

1 个答案:

答案 0 :(得分:0)

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