I have developed a new flavor of my application. Now when uploading it on the store, I have an error : "You need to use a different package name..." because the first version of the app is already on the store.
I have followed this recommendation.
http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename
I need a new manifest file for this new flavor, so I deleted the <manifest> attribute package="..." in the manifest of my new flavor.
As stated at the bottom of the above mentioned page:
NOTE 2:
The package name must always be specified in the default AndroidManifest.xml file. If you have multiple manifests (e.g. a flavor specific manifest or a buildType specific manifest), the package name is optional, but if it is specified it must be identical to the package specified d in the main manifest.
So now I run into this problem:
Error:Execution failed for task ':app:process***Manifest'.
Manifest merger failed : Attribute application#name value=(.Application) from AndroidManifest.xml:25:9-49
is also present at AndroidManifest.xml:25:9-49 value=(.HomeOnTheSpotApplication).
Suggestion: add 'tools:replace="android:name"' to element at AndroidManifest.xml:25:5-147:19 to override.
So I tried to add tools:replace="android:name" to the application application element but then I had this error (app crashing when starting):
FATAL EXCEPTION: main java.lang.RuntimeException: Unable to instantiate application newFlavor.Application: java.lang.ClassNotFoundException: Didn't find class "*.Application" on path: /data/app/.apk
I also tried to add 'tools:node="replace"' to the application element
But then it throws this message when trying to start the application:
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp="flavor2"./"flavor1"..activity.splash.SplashActivity_ }
Error type 3
Error: Activity class {"flavor2"./"flavor1"..activity.splash.SplashActivity_} does not exist.
I'm out of ideas now :/
Related
Following error appearing while installing app on emulator.
'''Failed to commit install session 27757417 with command package install-commit 27757417. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl27757417.tmp/base.apk (at Binary XML file line #57): com.nfs.mobility.myapp.activities.SplashActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present''''
This error message "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI" appears when there is a problem with the AndroidManifest.xml file of the app.
In this particular case, the error message mentions that there is an issue with the com.nfs.mobility.myapp.activities.SplashActivity activity in the AndroidManifest.xml file, specifically that it is targeting Android 11 (S+) and above but doesn't have an explicit value for android:exported when intent filters are present.
Here are some of the solutions:
Check the AndroidManifest.xml file for errors such as missing tags,
incorrect formatting, or missing permissions
Make sure that the android:exported attribute is set to "true" for activities that should be accessible from other apps, or to "false" for activities that should not be.
Make sure that the activity's intent filters are correctly defined.
Try cleaning and rebuilding the project in Android Studio.
Try uninstalling the older version of the app from your device
before installing the new version.
Merging Errors:
Error: android:exported needs to be explicitly specified for element <receiver#com.onesignal.GcmBroadcastReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. app main manifest (this file), line 57
Error: android:exported needs to be explicitly specified for element <receiver#com.onesignal.BootUpReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. .app main manifest (this file), line 93
Error: android:exported needs to be explicitly specified for element <receiver#com.onesignal.UpgradeReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
.app main manifest (this file), line 100
It explains itself s you need to add android:exported="true or false" for your Receiver GcmBroadcastReceiver
If u don't intend to upload your app to play Store you can downgrade your API to 30 and it will work without you adding android:exported for every activity.
I would like to build the game in android 12. I know I need to add the android:exported="true" into activity tag which included intent-filter.
So I already added the android:exported="true" into activity tag in my AndroidManifest.xml. But I built on the android 12 device is still has error.
Installation failed due to: 'Failed to commit install session 1567366667 with command cmd package install-commit 1567366667. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1567366667.tmp/base.apk (at Binary XML file line #136): com.unity.purchasing.googleplay.VRPurchaseActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
But I don't know what is VRPurchaseActivity and I don't add this activity to my AndroidManifest.xml.
So anyone know how to fix this issue. Thank a lots.
The activity comes from Unity but there is a way to override its attributes. Put this inside your manifest:
<activity android:name="com.unity.purchasing.googleplay.VRPurchaseActivity">
android:exported="false"
tools:node="merge" />
I am receiving the following error when I try to test my app on Android:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-36 value=(com.carbery.qiGangApp)
has a different value=(com.carbery.qiGangApp) declared in main manifest at AndroidManifest.xml:2:5-29
Suggestion: remove the overlay declaration at AndroidManifest.xml and place it in the build.gradle:
flavorName {
applicationId = "com.carbery.qiGangApp"
}
A little history, I did use another app as a template for starting this one and so I changed the name and the applicationId. Originally when running the app for Android I received the same error as above, but with the old name. I then did a Find through all my files and changed the old name to the new one. The correct name is: com.carbery.qiGangApp
However I am still receiving the error, now even though the two values it refers to, look to be the same correct ones.
As I come from an Ios back ground, I am not so familiar with the Android set up. So any help with solving this would really be gratefully received.
Many thanks
I was able to recreate your problem it seems that you need to sync your package name across multiple AndroidManifest.xml files.
Try to update this 3 AndroidManifest.xml files:
I tried to build and run my program. but I saw this message. what can I do?
Rishe is app name
Error 1 :
Error 2 :
Thanks in advance !
android.name is the class of your activity, not the application's name. Check the android developer's startup document.
error1 -> there is conflict coming with your app module manifest file with other module manifest file. see manifest merger tool http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger or find how to merge mainifest file
error2 -> you are defining 3 activity with same name that is why it is giving error