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

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>

Related

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

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>

android "use $ instead of ." produce cannot resolve symbol

In my manifest. with the new SDK, it requires me to replace my android:name paths with the warning:
use $ instead of . for inner classes(or use only lowercase letters in package name)
This is one of my activities:
<activity
android:name=".Activities.LoginActivity" >
</activity>
and it suggest me to replace it with
<activity
android:name=".Activities$LoginActivity" >
</activity>
The problem is that this produce the following:
Cannot resolve symble Activities
So, what I have to do? I just ignore the alert or I have to replace it someway else?
EDIT:
here is the source of activities folder:
app.java.personal.pier.myapp.Activities
this is my entire manifest, I don't think it should be need but just in case it is here :)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="personal.pier.myapp" >
<uses-permission android:name="andorid.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="true" >
<activity
android:name=".Activities.SplashScreenActivity"
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=".Activities.LoginActivity" >
</activity>
<activity
android:name=".Activities.HomePageActivity" >
</activity>
<activity
android:name=".Activities.FoodAddActivity" >
</activity>
<activity
android:name=".Activities.FoodManagementActivity" >
</activity>
<activity
android:name=".Activities.FoodDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingSuntActivity" >
</activity>
<activity
android:name=".Activities.EatingDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingAddActivity" >
</activity>
<activity android:name=".Activities.SportAddActivity" >
</activity>
</application>
</manifest>
The most likely problem appeared because you are using upper case in your package name.

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>

Setting Wrong Application Name

I have my application named Umall but it is replaced by Slash that is my First Activity i am stuck with that small problem don't know how to handle it.. i gave application name directly in application lable
My Manifest.XML is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ef.umall"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="Umall"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="" >
</activity>
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.HomeActivity"
android:label="#string/title_activity_home" >
</activity>
<activity
android:name=".activity.ProductsListActivity_"
android:label="#string/title_activity_products_list" >
</activity>
<activity
android:name=".activity.ProductDetail_"
android:label="#string/title_activity_product_detail" >
</activity>
<activity
android:name=".activity.CartActivity_"
android:label="#string/title_activity_cart" >
</activity>
<activity
android:name=".activity.ProductActivity_"
android:label="#string/title_activity_product" >
</activity>
<activity
android:name=".activity.UmallBaseActivity_"
android:label="#string/title_activity_umall_base" >
</activity>
<activity
android:name=".activity.ShopingChart"
android:label="#string/title_activity_shoping_chart" >
</activity>
</application>
</manifest>
Try to define the application name in your string.xml file and then replace this line :
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="#string/appname"
android:theme="#style/AppTheme" >
Where "appname" is a string in string.xml like :
<string name="appname">Umall</string>
can have a label attribute. If it's absent the label is inherited from the parent component (either Activity or Application). So using this, you can set a label for the launcher icon, while still having the Activity with it's own title.
so change this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
to this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter android:label="Umall">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
better to use #string/app_name
more info here

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"

Categories