AAPT2 error: check logs for details: unknown element <action> found
AAPT2 error: check logs for details: unknown element <action> found
这是我的 debug\AndroidManifest.xml
出现了很多类似
的错误
Element action is not allowed here.
Element category is not allowed here.
Attribute android:versionCode is not allowed here.
Attribute android:versionName is not allowed here.
Attribute android:theme is not allowed here. and so many.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.sqh.adio"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@drawable/logo_remaking2"
android:label="@string/label"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.company.sqh.adio.MainActivity"
android:icon="@drawable/logo_remaking2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.registraion_form" >
<intent-filter>
<action android:name="com.company.sqh.adio.registraion_form" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.contact_us" >
<intent-filter>
<action android:name="com.company.sqh.adio.contact_us" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.about_us" >
<intent-filter>
<action android:name="com.company.sqh.adio.about_us" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.ProfileActivity" />
<action android:name="com.company.sqh.adio.ProfileActivity" />
<category android:name="android.intent.category.DEFAULT" />
<activity android:name="com.company.sqh.adio.EmplyReg" />
<activity android:name="com.company.sqh.adio.SubCategory" />
<activity android:name="com.company.sqh.adio.User_Profile" />
<activity android:name="com.company.sqh.adio.Emp_list" />
<activity android:name="com.company.sqh.adio.Forgot_Pass" />
<meta-data
android:name="android.support.VERSION"
android:value="26.1.0" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="android.arch.lifecycle.VERSION"
android:value="27.0.0-SNAPSHOT" />
</application>
</manifest>
请检查这个
AndroidManifest.xml:15: error: unknown element found.
您放错了标签。
To improve incremental resource processing, Android plugin 3.0.0 enables AAPT2 by default.
In previous versions of AAPT, elements nested in incorrect nodes in the Android manifest are either ignored or result in a warning.
To resolve the issue, make sure your manifest elements are nested correctly. For more information, read Manifest file structure.
您必须修改您的清单:
<action android:name="com.company.sqh.adio.ProfileActivity" />
<category android:name="android.intent.category.DEFAULT" />
它们应该包含在 <activity>
标签中。
您可以阅读more here。
在我的例子中,我遇到了这个错误 (AAPT2) 使用 Cordova 构建命令构建 apk,原来这是一个./gradle 用户依赖项的路径引起的问题。
问题是我的用户名有特殊字符的路径本身。 Gradle 正在阅读“?”而不是“Á”,创建一个新用户解决了这个问题。
OS: Windows 10
这是我的 debug\AndroidManifest.xml
出现了很多类似
的错误Element action is not allowed here.
Element category is not allowed here.
Attribute android:versionCode is not allowed here.
Attribute android:versionName is not allowed here.
Attribute android:theme is not allowed here. and so many.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.sqh.adio"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@drawable/logo_remaking2"
android:label="@string/label"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.company.sqh.adio.MainActivity"
android:icon="@drawable/logo_remaking2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.registraion_form" >
<intent-filter>
<action android:name="com.company.sqh.adio.registraion_form" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.contact_us" >
<intent-filter>
<action android:name="com.company.sqh.adio.contact_us" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.about_us" >
<intent-filter>
<action android:name="com.company.sqh.adio.about_us" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.company.sqh.adio.ProfileActivity" />
<action android:name="com.company.sqh.adio.ProfileActivity" />
<category android:name="android.intent.category.DEFAULT" />
<activity android:name="com.company.sqh.adio.EmplyReg" />
<activity android:name="com.company.sqh.adio.SubCategory" />
<activity android:name="com.company.sqh.adio.User_Profile" />
<activity android:name="com.company.sqh.adio.Emp_list" />
<activity android:name="com.company.sqh.adio.Forgot_Pass" />
<meta-data
android:name="android.support.VERSION"
android:value="26.1.0" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="android.arch.lifecycle.VERSION"
android:value="27.0.0-SNAPSHOT" />
</application>
</manifest>
请检查这个
AndroidManifest.xml:15: error: unknown element found.
您放错了标签。
To improve incremental resource processing, Android plugin 3.0.0 enables AAPT2 by default. In previous versions of AAPT, elements nested in incorrect nodes in the Android manifest are either ignored or result in a warning.
To resolve the issue, make sure your manifest elements are nested correctly. For more information, read Manifest file structure.
您必须修改您的清单:
<action android:name="com.company.sqh.adio.ProfileActivity" />
<category android:name="android.intent.category.DEFAULT" />
它们应该包含在 <activity>
标签中。
您可以阅读more here。
在我的例子中,我遇到了这个错误 (AAPT2) 使用 Cordova 构建命令构建 apk,原来这是一个./gradle 用户依赖项的路径引起的问题。 问题是我的用户名有特殊字符的路径本身。 Gradle 正在阅读“?”而不是“Á”,创建一个新用户解决了这个问题。
OS: Windows 10