Android资源链接失败(守护程序:AAPT2 aapt2-3.2.1-4818971-windows守护程序#0)

时间:2018-11-12 18:52:28

标签: java android

这是我的错误消息,对此我该怎么办?

  

Android资源链接失败输出:   D:\ Furkan \ HotWallpaper \ app \ src \ main \ res \ layout \ activity_main.xml:10:   错误:“ match_parent”与属性layout_weight不兼容   (attr)浮动。错误:链接文件资源失败。

     

命令:   C:\ Users \ PALA.gradle \ caches \ transforms-1 \ files-1.1 \ aapt2-3.2.1-4818971-windows.jar \ b5935268f2c301ed81b7b1e07a1e89af \ aapt2-3.2.1-4818971-windows \ aapt2.exe   链接-I \           C:\ Users \ PALA \ AppData \ Local \ Android \ Sdk \ platforms \ android-28 \ android.jar \            - 表现\           D:\ Furkan \ HotWallpaper \ app \ build \ intermediates \ split-apk \ debug \ resources \ AndroidManifest.xml \           -o \           D:\ Furkan \ HotWallpaper \ app \ build \ intermediates \ processed_res \ debug \ processDebugResources \ out \ resources-debug.ap_ \           -R \           @D:\ Furkan \ HotWallpaper \ app \ build \ intermediates \ incremental \ processDebugResources \ resources-list-for-resources-debug.ap_.txt \           --auto-add-overlay \           --java \           D:\ Furkan \ HotWallpaper \ app \ build \ Generated \ not_namespaced_r_class_sources \ debug \ processDebugResources \ r \           --custom-package \           com.example.pala.hotwallpaper \           -0 \           apk \           --preferred-density \           420dpi \           --output-text-symbols \           D:\ Furkan \ HotWallpaper \ app \ build \ intermediates \ symbols \ debug \ R.txt \           --no-version-vectors守护程序:AAPT2 aapt2-3.2.1-4818971-windows守护程序#0

2 个答案:

答案 0 :(得分:1)

在您的activity_main中,您将match_parent分配给了layout-weight而不是layout-width
因此,导致该错误的原因是一个简单的错字。

答案 1 :(得分:0)

单击内部版本,选择显示错误之处的下拉列表。它将使您对导致错误的资源文件有所了解。