Android资源链接失败.....错误:链接引用失败

时间:2018-12-04 11:59:30

标签: android reference linker resources

我的Android应用从Google Play中取消发布,因为该项目中有很多权限。但是现在我需要更新我的项目,并且在上传到Play商店时,我将在应用页面上声明所有权限。 现在,我已经安装了Studio 3.2.1并导入了项目,但是遇到了一些无法摆脱的问题。即使在Internet上搜索解决方案之后。

我得到如下的编译错误: Android资源链接失败

输出:

C:\VikAndProjects\VikAllInDialogs\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:740: error: resource android:attr/preserveIconSpacing is private.
error: failed linking references.

Command: C:\Users\VivekTheGreat\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\04715f967a002ffd330f576b4f8cb914\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        E:\VikAndSDK\platforms\android-22\android.jar\
        --manifest\
        C:\VikAndProjects\VikAllInDialogs\app\build\intermediates\instant_run_merged_manifests\debug\processDebugManifest\instant-run\AndroidManifest.xml\
        -o\
        C:\VikAndProjects\VikAllInDialogs\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\VikAndProjects\VikAllInDialogs\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\VikAndProjects\VikAllInDialogs\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        vik.practice.allindialogs\
        -0\
        apk\
        --preferred-density\
        xxhdpi\
        --output-text-symbols\
        C:\VikAndProjects\VikAllInDialogs\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

I can't change or Edit anything in "....intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml" file. Once I "Run" or "Build Project" after editing the values.xml file it RETURNS to the present file.

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

浏览应用程序的资源,类似于app_project/app/src/main/res/values/<filename>.xml。这些文件之一引用了android:attr/preserveIconSpacing-该资源是android平台中的私有属性,因此您需要将其删除。