- Home /
Multiple APK for Android from same project, only one at a time installs
I have a project with multiple scenes and I generate a different APK from each scene, say APK1 and APK2. When I go to install the APKs on an Android device ( I tried several) only one suck APK gets installed. So if I have installed APK1, in order to install APK2 I need to first uninstall APK1, otherwise I get the error "Application not installed".
Seemed likely it was a naming / bundle problem, but I have that each APK has
unique Product Name
unique Bundle Identifier
unique file name
and still there is some conflict. I also have "Automatic" on Install location.
Thanks.
$$anonymous$$ay I ask why you want each scene on an apk? Why not add/remove the scene you want from the build settings?
That is exactly what I am doing :-) But the resulting builds do not install together on the same device :-(
I don't think I did. Not using that config any more, sorry. Could be I solved it generating and using distinct certificates.
Answer by JayGarxP · Oct 25, 2018 at 09:54 PM
Easiest way is to change the Identification settings:
In Top Menu: (Edit > Project Settings > Player), change Product Name field (App icon title) and then
under Other Settings > Identification >
Change all ID strings to be unique from past builds Package Name Version +0.1 for major changes, +0.0.1 for minor
Next, do not hit Build and Run just yet, Go into build settings and hit build and save the .apk file into a folder called 'Builds' (create it if it doesn't exist), on some versions of Unity if you don't put builds in their own folder the .apk s may overwrite each other automatically.
Now you can hit Build and Run and the apk will be installed to the android phone as a separate app, useful for building out specific scenes you want to test. Or show someone how the level/game has been improved.
.
Also, don't forget to use the Unity Remote App so you can test levels without having to build an entire .apk passed through and installed on USB, and to expose magic numbers as public properties so that they can be tweaked during runtime.
I tried following this but it doesn't work. Still, the phone sees the two apks the same. Help me please :(
Answer by Denscrivent · Dec 20, 2016 at 03:37 AM
I Create a project and I duplicate it. On the duplicated ones, I change all the IDs needed (bundle id, plugin IDs, etc) and I use another keystore. However, I'm having the same problem.