Android studio错误:链接文件资源失败

时间:2018-11-26 16:57:34

标签: android

你好,我在android studio中进行编码,突然开始出现此错误。尝试了一些他们没有用的解决方案。任何帮助都很好。非常感谢你!

       Android resource linking failed
Output:  C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\src\main\res\layout\activity_ent_buil.xml:24: error: attribute android:TextSize not found.
error: failed linking file resources.

Command: C:\Users\Liad Rosenberg\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\1ad82ce000af4f9770f30f2680cd1694\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        D:\Users\Liad Rosenberg\AppData\platforms\android-28\android.jar\
        --manifest\
        C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.example.liadrosenberg.application\
        -0\
        apk\
        --output-text-symbols\
        C:\Users\Liad Rosenberg\Desktop\Application2\Application2\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

有帮助吗? 谢谢     尝试过:it says "error: failed linking file resources." and all the R are red没有工作。我还能做些什么来使其恢复正常工作? 非常感谢

2 个答案:

答案 0 :(得分:1)

首先,在“工具”选项卡中尝试使用CleanProject。如果那样的话,接下来不同步项目并检查。如果在File-> Invalidate cache中无效,然后重新启动。它将提供干净清晰的资源链接。

答案 1 :(得分:0)

转到activity_ent_buil.xml第24行,然后替换

android:TextSize 

android:textSize