I have a question about app install and update the same app.
On my phone, when I install my app it updates the old one every time I compile a new one. It was obvious for me because same app, compiled under the same account, keystore and everything.
I installed it on my coworkers phone too. Today, I updated it and on his phone and it made a new install, new app instead of updating the old one so there was 2 of the same app (different version). We both have Samsung phone, (not the same type), Android version is the same (15).
What caused it? I thought it straightforwardly updates when made under the same account.
OK, I was not clear enough. I did not change version number. Just modified the blocks. I meant different version that way. Did not change version number in properties.
So, why does it update on my phone without increment it? Always worked this way. Even on my previous phone. Well, I will try increment next time and see how does it work, but just weird.
The important thing is to use the same login and same project name to get the same package name
Usually you increment version number and name too, which is required for Google Play, but updating on your device also works without that
Most probably you changed the project name, which results in another package name so the app gets installed as new app and now there are 2 versions of the same app on your device
Everything was the same. Also it is a private app, not a GP app. I just downloaded it from the AI2 server with the QR-code after modified some blocks. Did not change anything in project properties. My phone updated the old app, my cooworker's phone kept the old one and installed it as a new app.
The only reason I can imagine is a package name difference, however you said, in your device it updated fine.
I also use a Samsung device and for me I can confirm, that app updates without incrementing version number and name work fine
Sorry, I'm out of further ideas, but I asked Gemini now, see the answer below.
Taifun
This situation can occur due to a mismatch in the signing key used to build the two APKs. When you sideload an app on Android, the operating system checks if the new APK is signed with the exact same key as the version already installed on the device.
Why It Happened
When you made changes and built a new APK without incrementing the version number, Android saw it as a different app because it was likely signed with a different key. Here's how it breaks down:
Your Device: The new APK you created was signed with the same key as the one already on your device. Android recognized the new APK as a valid update and replaced the old version.
Your Friend's Device: The APK you gave your friend was signed with a different key than the version they had installed. Android's security model prevents an app signed with one key from overwriting an app signed with another. Instead of updating, Android treats the new APK as a completely different application and installs it alongside the existing one.
How to Fix It
To prevent this, you must always use the same signing key for all versions of your app. Follow these steps:
Locate your original keystore file. This file contains the private key used to sign your app. It's crucial for all future updates.
Use the same key for new builds. When you build your APK, make sure to configure your development environment to use the same keystore file and alias. In Android Studio, this is managed in the build.gradle file or the signing configurations in the IDE.
Increment the version number. While not the cause of the double app issue, it is a best practice to always increment the versionCode and versionName for every new release. This helps Android and app stores properly manage updates.
By consistently using the same signing key, you'll ensure that future updates are correctly recognized and installed as an upgrade rather than a new application.
Oh and one last note. I think keystore does not matter for private apps. At least it did not about five years ago. That time it tried with 2 account (company and my private) the same app compiled under each account with booth keystore one by one. Keystore did not matter.App with one keystore could updtae the app with the other keystore under same account. (for private apps at least, on Samsungs) .I dont know about Google Pay apps.