Android Studio 3.0 Manifest Error: unknown element found

前端 未结 8 1596
自闭症患者
自闭症患者 2020-11-28 11:28

NOTICE: Please do not post this \"android.enableAapt2=false\" as an answer. It is not a solution. It is jus

8条回答
  •  半阙折子戏
    2020-11-28 12:14

    You have a misplaced tag. The new AAPT (AAPT2) now throws an error on this.

    From the docs in here: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

    Behavior changes when using AAPT2


    To improve incremental resource processing, Android plugin 3.0.0 enables AAPT2 by default. Although AAPT2 should immediately work with older projects, this section describes some behavior changes that you should be aware of.

    Element hierarchies in the Android manifest

    In previous versions of AAPT, elements nested in incorrect nodes in the Android manifest are either ignored or result in a warning. For example, consider the following sample:

    
       
               
                   
                   
               
               
           
       
    
    

    Previous versions of AAPT would simply ignore the misplaced tag. However, with AAPT2, you get the following error:

    AndroidManifest.xml:15: error: unknown element  found.
    

    To resolve the issue, make sure your manifest elements are nested correctly. For more information, read Manifest file structure.

提交回复
热议问题