Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android manifest with XML empty tags?

Tags:

android

In the manifest of my app, activities are highlighted in yellow and indicated:

XML tag has empty body

Reports empty tag body. The validation works in XML/JSP/JSPX/HTML/XHTML file types

enter image description here

I'm looking for information, but do not quite understand the message refers.

I appreciate any help to know that I'm doing wrong.

like image 981
Sergio76 Avatar asked Sep 08 '15 09:09

Sergio76


People also ask

What does Android manifest XML file contains?

Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.

How do I change AndroidManifest XML?

Open your Android project and go to <AppProjectFolder>/app/src/main/. Open the app manifest file AndroidManifest. xml and add the following lines to the file as child elements of the <manifest> element. Note: You must include the QUERY_ALL_PACKAGES permission if your app targets Android 11 (API Level 30) or higher.

Where can I find AndroidManifest XML file?

It is located under android folder inside your monaca project as shown below: For Cordova 6.2 or higher, AndroidManifest. xml file is removed from Monaca framework. Therefore, in order to config Android application settings, use Android Configuration Page.


1 Answers

XML tag has empty body

The refers to your <activity> tags as you are closing them with a </activity> instead of <activity (rest of code here...) />

Using an explicit </activity> implies there is a body to your <activity> such as in this example:

<activity
        android:name=".SplashActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>

Whereas you are wanting something along these lines:

<activity
        android:name=".MainActivity"
        android:label="@string/app_name" />

With the /> at the end to get rid of these warnings

like image 115
Ed George Avatar answered Oct 21 '22 06:10

Ed George