首页 > 解决方案 > Android studio 3.2,Android SDK Tools 26.0.2 错误:Android 资源链接失败

问题描述

嘿,伙计们,我的 android studio 有问题,错误是:

`Android资源链接失败输出:

/Users/omar_sameh/Desktop/CarzyOS/app/src/main/res/layout/activity_main.xml:9: error: 'RecyclerView' is incompatible with attribute id (attr) reference.
error: failed linking file resources.

Command: /Users/omar_sameh/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-osx.jar/7761ac785c77afbee7829c87129e0c02/aapt2-3.2.0-4818971-osx/aapt2 link -I\
        /Users/omar_sameh/Library/Android/sdk/platforms/android-27/android.jar\
        --manifest\
        /Users/omar_sameh/Desktop/CarzyOS/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
        -o\
        /Users/omar_sameh/Desktop/CarzyOS/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
        -R\
        @/Users/omar_sameh/Desktop/CarzyOS/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        /Users/omar_sameh/Desktop/CarzyOS/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
        --custom-package\
        com.example.omar_sameh.carzyos\
        -0\
        apk\
        --output-text-symbols\
        /Users/omar_sameh/Desktop/CarzyOS/app/build/intermediates/symbols/debug/R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-osx Daemon #0
` 

有什么建议么 ?

标签: androidandroid-studio

解决方案


根据您的 xml 文件, attr 元素无效

activity_main.xml:9: error: 'RecyclerView' is incompatible with attribute id (attr) reference. error: failed linking file resources.

推荐阅读