I decided to have few versions of the same app on the phone.
I clicked 'run' on first version of app in eclipse and apk was installed with the name: 'p2'. Then I changed package statement in Manifest to 'p5' , and changed all links in application classes and xmls, rebuilded app and clicked 'run' again to install next apk on the same phone.
To my astonishment I have two applications with name 'p2'.
I expected to see 'p2' and 'p5'.
I was looking for an occurence of 'p2' in my code but there was no such place.
Can you guide me to solve this?
To install the same application on the same device do followed steps:
change Application package (where your main Activity is located)
change Application Name (optional, doesn't seem good two equal names on the same device)
If you compile applications from Eclipse, you must change also .project file:
<projectDescription>
<name>Appl</name>
otherwise you can't import second application with the same name
Related
Okay so i have an application, put up on the playstore.
What i want now, it to create the same application but with debug postfix in the name and it must have everything same.
I want to do this, because i do not want to disturb my original project when i am experimenting stuff,
So what i did was, i copied the project folder from wherever it was to the desktop, original one had the package name com.femindharamshi.spa so i refactored the whole thing to com.femindharamshidebug.spadebug and all changed the app_name in string
but when i try to open this app in the emulator, Android Studio Gives me the following error :
Installation failed with message Failed to finalize session :
INSTALL_FAILED_INVALID_APK: Split_lib_slice_4_apk was defined multiple
times. It is possible that this issue is resolved by uninstalling an
existing version of the apk, if it is present, and then re-installing
Also i do not want to uninstall the original app from the emulator/physical device, i just want to add this app for testing purposes. What should i do ?
Try closing the Android Studio and giving clean and build to the project.
change you application ID in app level build.gradle file and sync the project
applicationId "//pkg id here"
I know that almost identical question was asked here, but accepted answer doesn't work for me.
Make apk with Capitalized package name in android studio
Let me explain.
Our Android app was developed in Xamarin.Android, we did a mistake with package naming - Visual Studio and Xamarin configured our's app manifest with uppercased package name (this was a mistake which now I pay with my sanity). It worked for Xamarin version, but we decided to rewrite that app in Android Studio after some releases. Now the problem begins...
We are not able to directly deploy/install apk on devices older than Android 8.0, we get following error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
It's funny that issue does not exists on devices with newest API.
It's clearly issue with our package name which is something like:
YES_We_Failed_On_It.We_Failed_Very_Badly
If I change it to lowercased everything works, but the case is we can't release another application with different package name.
Is there any possibility to fix this?
It will be self answer question.
If anyone else will be at my position, fix is quite simple.
As mentioned in docs: https://developer.android.com/studio/build/application-id.html
When you create a new project in Android Studio, the applicationId exactly matches the Java-style package name you chose during setup. However, the application ID and package name are independent of each other beyond this point. You can change your code's package name (your code namespace) and it will not affect the application ID, and vice versa (though, again, you should not change your application ID once you publish your app).
Application ID and Java package name are not the same.
So to fix this I renamed my package to be lowercased and stayed with uppercased Application ID. Problem disappeared.
At the end of build, build tools copy our Application ID into final APK's manifest, that's why it's still the same package I think.
Also from docs:
One more thing to know: Although you may have a different name for the manifest package and the Gradle applicationId, the build tools copy the application ID into your APK's final manifest file at the end of the build.
I have an app that started in eclipse. The package name starts with a capital, and it always compiled and installed correctly. Now that I have moved the project into android studio, while the app will compile, it won't install due to a malformed manifest. I looked up this problem, and the suggestion was to lowercase the package name. This dose solve the problem, and the app installs, but this makes no sense. Why would apps compiled in eclipse be fine with it, but the same code in Android Studio not work? This is a large problem, as the app is already in the play store, and I can't lowercase the package name, so I'm stuck in eclipse. Dose anyone know a work around?
Maybe google play is not case sensitive and thats why it doesn't recognize the upercase package name, you might be able to post an update with the same package name but lowercase. Have you tried it?
Had the same problem with capitals in old package name. In studio simply rename the package in build.gradle (Module:app) from com.abc.example to com.ABC.example sync the project and all should be well.
In Android Studio rename the package name and in build.gradle leave old applicationId.
Although your project's package name matches the application ID by default, you can change it. You should never change the application ID.
More: https://developer.android.com/studio/build/application-id.html#change_the.package_name
I want to try 2 difference version of the same app on my tablet.
So imported both project in eclipse with different project name.
I changed the name of the app in the manifest, I changed the icon to be able to recognize them on my desktop ...
I just can't get both on the phone at the same time. I can execute them both, but installing one is gonna erase the other.
I guess its the change I'm looking for is in the manifest.xml, still I can't find it.
You have to change your package name. A Package name must be unique for every app.
From the official doc
Package Name is the package namespace for your app (following the same
rules as packages in the Java programming language). Your package name
must be unique across all packages installed on the Android system.
For this reason, it's generally best if you use a name that begins
with the reverse domain name of your organization or publisher entity.
In Eclipse, in the Package Explorer select the com.xxxx.yyyy in the src/ directory of the project whose manifest you changed. Right click -> Refactor -> Rename. Enter a new package name, e.g. com.abc.test
Then, in the manifest XML, also replace all instances of "com.xxxx.yyyy" with the new "com.abc.test" package name.
I'm trying to build lite version of an android project..so far, I've read that renaming application package (I've used eclipse option for renaming app package) should be enough. I've checked in manifest.xml, package is renamed, but when I install my app on phone (or on a emulator) it seams to mix somehow versions, specially after pressing home button and then re-entering the application (it switches to previously installed full version).
what am I missing? Is there something else to change in order to get different version of application? Should I change application name or maybe source packages?
When changing a package name you also need to change the name of your files. So if your app was originally my.app.full then the files under src will be my/app/full. If you change your package name to my.app.lite then you need to change the film names under src to my/app/lite.
Also at the top of all your classes you should have a package declaration ie. package my.app.full, which also needs to be changed to your new package name - package my.app.lite
If you are still having problems, try refreshing the build, and then if that doesn't work delete the gen file (don't worry it will reappear when you build your project)