Exception:
Caused by: com.android.builder . internal.aapt .v2.Aapt2Exception: AAPT2 error: check logs for details
at com.android.builder . png.AaptProcess $N otifierProcessOutput.handleOutput ( AaptProcess.java:443 )
at com.android.builder . png.AaptProcess $N otifierProcessOutput.err ( AaptProcess.java:395 )
at com.android.builder . png.AaptProcess $ ProcessOutputFacade.err ( AaptProcess.java:312 )
at com.android.utils .GrabProcessOutput$1.run( GrabProcessOutput.java:104 )
All r documents are wrong and red;
Aapt2 explains:
AAPT is the full name of Android asset packaging tool. It is an indispensable tool to build app and even Android system. Its function is to compress and package all resource files into Android APK. We can find it in the Android SDK directory. For example, I can find it in my directory D: SDK, build tools, 28.0.2, and other versions of build tools;
Aapt2 is a new version of AAPT. Starting from Android studio 3.0, it is used as the default resource packaging tool.
terms of settlement:
1. Click toggleview to view the execution output of gradle more clearly;
After clicking, it is shown as follows:
2. The red output information in the figure above has the following information:
AGPBI: {"kind":"error","text":"error: resource drawable/shape_round (aka com.liyuhuyu.liyu:drawable/shape_round) not found.","sources":[{"file":"E:\\Project\\LiYuTwo\\app\\src\\main\\res\\layout\\item_water.xml","position":{"startLine":10}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource drawable/popupwindow_close (aka com.liyuhuyu.liyu:drawable/popupwindow_close) not found.","sources":[{"file":"E:\\Project\\LiYuTwo\\app\\src\\main\\res\\layout\\popupwindow_pay_select.xml","position":{"startLine":62}}],"original":"","tool":"AAPT"}
3. From the above prompt output information, we can know the following:
1) The file where the error occurred is item_ water.xml ;
2) The reason for the mistake is android:background Property value “@ drawable / shape”_ “Round” not found
4. Open item_ water.xml File, find the error location, as shown in the above output information error; delete or correct it;
Conclusion:
1) In fact, the reason for my error is that the referenced resource file cannot be found;
2) Aapt2 is a tool for packing resource files. If aapt2 reports an error, it is usually a problem with the resource file.
Other solutions:
Many solutions on the Internet say that the project is successful gradle.properties Add a line to“ android.enableAapt2=false “To shut down aapt2
Other knowledge:
Use AAPT to view the app package name and other information
1, use CD in the command line of CMD to switch to the directory where AAPT is located
2. Enter the command “AAPT dump bagging C: / / users / administrator / desktop / find fault 201905171701. APK” to run, OK;
The path of the app is C: users, administrator, desktop, 201905171701.apk
Read More:
- Android studio compile and run report: AAPT2 error: check logs for details
- Some file crashing failed, see logs for details
- Android Studio Error: Some file crunching failed, see logs for details
- Android Studio Error:Some file crunching failed, see logs for details
- How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm
- Android Studio Install Error Failed to install Intel HAXM. For details, please check the installation log
- Command errored out with exit status 1: python setup.py egg_info Check the logs for full command ou
- AAPT: error: resource android:attr/colorError not found.
- AAPT: error: resource android:attr/dialogCornerRadius not found.
- AAPT: error: ‘null‘ is incompatible with attribute button (attr) reference.
- Resolution AAPT: error: resource drawable/ (aka xxx) not found
- Server check fail, please check server 192.168.11.13 ,port 9848 is available , error ={}
- Android Studio error “Manifest merger failed with multiple errors, see logs” solution
- Android studio AAPT: error: attribute android:requestLegacyExternalStorage not found.
- Packet Title: logs.pcapng
- “Failed to convert @ drawable / XX into a drawable exception details are logged in window”
- Manifest merger failed with multiple errors, see logs [How to Solve]
- The usage details of SVM
- Manifest merger failed with multiple errors, see logs