I am trying to create an android app for watchduino2.. When i follow the provided steps i encounter the error
AAPT: error: unexpected element <uses-permission> found in <manifest><application>
Can somebody explain this problem? And also help me to resolve it as well.
Manifest declarationsCamera Permission - Your application must request permission to use a device camera. Note: If you are using the camera by invoking an existing camera app, your application does not need to request this permission.
The name of the permission. It can be a permission defined by the application with the <permission> element, a permission defined by another application, or one of the standard system permissions (such as "android. permission. CAMERA" or "android.
<uses-permission>
needs to be a child of the root <manifest>
element. You have it as a child of the <application>
element. So, move the <uses-permission>
element.
So, you have something like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.whatever">
<application android:icon="@drawable/icon"
android:debuggable="true"
android:label="@string/app_name">
<uses-permission android:name="android.permission.INTERNET"/>
<!-- other stuff here -->
</application>
</manifest>
It needs to be more like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.whatever">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="@drawable/icon"
android:debuggable="true"
android:label="@string/app_name">
<!-- other stuff here -->
</application>
</manifest>
it might be about misplaced tag, make sure your manifest elements are nested correctly
Previous versions of AAPT would simply ignore the misplaced tag. However, with AAPT2, you will get error
read below official document for proper Manifest structure :
Manifest File Structure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With