Android Studio AAPT2 error: Check the logs for details

Common errors: AAPT2 error: check logs for details

AAPT is the full name of Android Asset Package Tool. It is a necessary tool for building an app and even an Android platform. Its role is to compress all the resource files in the Android APK. We can find it in the Android SDK directory.

AAPT2 is a new version of AAPT. Starting with Android Studio 3.0, it is used as the default resource filler.

Some people say that it appears because there is a Chinese in the gradley storage path, but I did not report an error.

Joint decisiongradle.propertiesAdd to fileandroid.enableAapt2=falseIt can be collected, but it will also give the following warning hints:

The option 'android.enableAapt2' isdeprecated and should not be used anymore.
Use 'android.enableAapt2=true' to removethis warning.
It will be removed at the end of 2018..

This means that this thing has been abandoned. It will be removed at the end of 2018. The warning is recommended to use “android. enableaaapt2 = true”. This entity entity is depressed, you have to set it to false, but it requires you to set it to true. Entity entity If set to False, the new version may not be supported by the end of the year. Entity entity Therefore, the best solution is to check the corresponding corrupted registry resources to find the corresponding resource.

For example, when using it, a specific error is reported:

style attribute @android:attr/windowEnterAnimation not found

Related resource file:

  <style name="myDialogAnim" parent="android:Animation">
      <item name="@android:windowEnterAnimation">@anim/dialog_enter</item>
      <item name="@android:windowExitAnimation">@anim/dialog_exit</item>

It is in xml style.@android:windowEnterAnimationmiddle@Just remove the character, it may not be supported in the new version and changed to:

  <style name="myDialogAnim" parent="android:Animation">
      <item name="android:windowEnterAnimation">@anim/dialog_enter</item>
      <item name="android:windowExitAnimation">@anim/dialog_exit</item>

At the same time, find the full style of the project style.@Remove icons. But there is a place in the above pattern how it can’t be changed:

<style name="Dialog.FullScreen" parent="Theme.AppCompat.Dialog">
        <item name="android:windowAnimationStyle">@myDialogAnim</item>

This always reports an error, and there is no way to change it to the following without the quotes

<item name="android:windowAnimationStyle">@null</item>

In short, the wrong place is changed, but sometimes we quote a third-party remote dependency library. Currently, if you report an AAPT2 error, that would be a concern. The essence of the essence because you can’t change it, you can only change itandroid.enableAapt2=falseThis is not a long way, and there is no solution. Essence Essence I can’t help but wait for Google to explain

Leave a Comment