AAPT: error: unexpected element <activity> found in <manifest><application><activity> - java

It specifies
ERROR:C:\Users\rafaw\OneDrive\Desktop\pp_rafa\pp_rafa\remindertest\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:27: AAPT: error: unexpected element <activity> found in <manifest><application><activity>.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.remindertest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="31" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:testOnly="true"
android:theme="#style/Theme.ReminderTest" >
<activity
android:name="com.example.remindertest.Activity2"
android:exported="false" />
<activity
android:name="com.example.remindertest.MainActivity"
android:exported="true" >
<activity android:name="com.example.remindertest.DestinationActivity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.example.remindertest.AlarmReceiver" />
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.example.remindertest.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
</provider>
</application>
</manifest>
I can launch my app/emulator though but a few features does not work. Do you guys know what's happening? Also when I open AndroidManifest it's normal but when I launch emulator it turns red, if I exit and open again it's back to normal yellow, though there is a red underline under the destination activity problem

update this manifest file with your manifest, and rebuild.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.remindertest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="31" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:testOnly="true"
android:theme="#style/Theme.ReminderTest" >
<activity
android:name="com.example.remindertest.Activity2"
android:exported="false" />
<activity android:name="com.example.remindertest.DestinationActivity" />
<activity
android:name="com.example.remindertest.MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.example.remindertest.AlarmReceiver" />
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.example.remindertest.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
</provider>
</application>
</manifest>

Related

Android Application Build Error: Manifest merger failed with multiple errors, see logs

I already build some other applications but in this time, I am facing an unfixable error. Please help me out.
In the error it show "Manifest merger failed with multiple errors, see logs". So, I'm giving my manifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sharpwebtechnologies.photoviewer" >
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.PhotoViewer"
tools:targetApi="31" >
<activity
android:name=".SplashScreen"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="false" >
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>

changed package name, now AndroidManifest.xml doesn't work

So, I tried to change the package by the following steps I found elsewhere on StackOverflow website:
create a new package
refractor the package to the new package
changing the package line in the form for the AndroidManifest.xml
btw I'm using Eclipse, if that's relevant.
However, I'm getting an error message in the AndroidManifext.xml file:
Parser exception for /GameProj/AndroidManifest.xml: The prefix "com.p.gameproj.Dataid" for attribute "com.p.gameproj.Dataid:name" associated with an element type "activity" is not bound At line 31.
Can someone tell me what the error message means?
Also, here's the AndroidManifest.xml file, if it's relevant:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
com.p.gameproj.Creditsname=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activitycom.p.gameproj.CharacterPageandroid:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
com.p.gameproj.StatPageame=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activitycom.p.gameproj.MapMain android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
com.p.gameproj.ScreenLocvity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc"com.p.gameproj.BattleScreen/activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</com.p.gameproj.InvScreen
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen"com.p.gameproj.ShopThing </activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>
Looks like something went wrong during your package name change. Probably a bad find/replace action. There are a several invalid attributes and elements in the AndroidManifest.xml file such as the following:
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
Notice the com.p.gameproj.Dataid:name=".Data". It should be android:name=".Data".
Once you fix all these bad values it should work again.
This should be close
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
android:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activity
android:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
android:name=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activity
android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
<activity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc">
</activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</activity>
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen">
</activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>

The Icon App dosen't appear in my activities

when I update my SDK the icon app doesn't appear in the activities I tried all the solution on the internet but nothing happened .. I tried also to put " android:icon" in each activities nothing change also made a custom actionbar also nothing change .. please any help?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >
"
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/CustomActionBarTheme" >
<activity
android:name=".Main"
android:label="#string/app_name"
android:theme="#style/NoActionBarTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Option"
android:label="#string/title_activity_option" >
</activity>
<activity
android:name=".CustomList"
android:label="#string/title_activity_custom_list" >
</activity>
<activity
android:name=".Social"
android:label="#string/title_activity_social" >
</activity>
<activity
android:name=".About"
android:label="#string/title_activity_about" >
</activity>
<activity
android:name=".ActionBar"
android:label="#string/title_activity_action_bar" >
</activity>
</application>
</manifest>

Why doesn't my Manifest file declare a java package?

I can't seem to find an answer to this, so I guess I'll ask it myself. No matter what I try, Eclipse claims that my AndroidManifest.xml file doesn't declare a java package. Here's my code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:name="hess.jacob.spindoctor"
android:versionCode="19"
android:versionName="4.4" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="hess.jacob.spindoctor.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Maybe someone can find the problem, and suggest a solution. I'd gladly appreciate it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hess.jacob.spindoctor"
android:versionCode="19"
android:versionName="4.4" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="hess.jacob.spindoctor.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Yes , Package name is missing
You have set the name , not the package.
android:name="hess.jacob.spindoctor"
It should be
package="hess.jacob.spindoctor"

ERROR getting 'android:name' attribute:

Hey guys im getting this error when i try to upload to the android market. Ive read some othere articles and have found that it comes from the manifest file, but i havent been able to locate it. Anybody have any suggestions?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="h6ttp://schemas.android.com/apk/res/android"
package="com.gymessentials.android"
android:versionCode="7"
android:versionName="1.6" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/gymessentials"
android:label="#string/app_name" >
<activity
android:name="com.gymessentials.android.WebViewActivity"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name="com.gymessentials.android.WebViewActivity2"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name="com.gymessentials.android.WebViewActivity3"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name="com.gymessentials.android.WebViewActivity4"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name="com.gymessentials.android.WebViewActivity5"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:name="com.gymessentials.android.WebViewActivity6"
android:theme="#android:style/Theme.NoTitleBar" />
<activity
android:label="#string/app_name"
android:name="com.gymessentials.android.MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Looks like you have a typo in the URL to the android namespace - in the manifest element at the very top of your file:
<manifest xmlns:android="h6ttp://schemas.android.com/apk/res/android"
...
Try taking out the "6".

Categories