其他分享
首页 > 其他分享> > Android资源链接失败错误:链接引用失败.画图

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

作者:互联网

我注意到我从前一天停止工作的地方启动android后无法链接所有可绘制文件:

Android resource linking failed
Output:  C:\Users\Access\AndroidStudioProjects\Devotion\app\src\main\res\layout\activity_main.xml:24: error: resource drawable/slide (aka com.accessng.devotion:drawable/slide) not found.
C:\Users\Access\AndroidStudioProjects\Devotion\app\src\main\res\layout\activity_read.xml:31: error: resource drawable/image (aka com.accessng.devotion:drawable/image) not found.
C:\Users\Access\AndroidStudioProjects\Devotion\app\src\main\res\layout\main_menu_item.xml:15: error: resource drawable/menu_bg (aka com.accessng.devotion:drawable/menu_bg) not found.
C:\Users\Access\AndroidStudioProjects\Devotion\app\src\main\res\layout\read_setting_bottom_sheet.xml:94: error: resource drawable/ic_night (aka com.accessng.devotion:drawable/ic_night) not found.
error: failed linking file resources.

Command: C:\Users\Access\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\b88544288ad13e2c86f99a94f775848a\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        C:\Users\Access\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
        --manifest\
        C:\Users\Access\AndroidStudioProjects\Devotion\app\build\intermediates\instant_run_merged_manifests\debug\processDebugManifest\instant-run\AndroidManifest.xml\
        -o\
        C:\Users\Access\AndroidStudioProjects\Devotion\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\Users\Access\AndroidStudioProjects\Devotion\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\Users\Access\AndroidStudioProjects\Devotion\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.accessng.devotion\
        -0\
        apk\
        --preferred-density\
        xhdpi\
        --output-text-symbols\
        C:\Users\Access\AndroidStudioProjects\Devotion\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

解决方法:

感谢所有评论,我在可绘制对象中添加了矢量资产文件,例如在添加文件时IDE崩溃了,并且xml的内容为空.一旦我删除了文件,一切都很好.但是错误日志从未提及该文件

标签:android-studio-3-0,android
来源: https://codeday.me/bug/20191211/2106442.html