• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help with Android Studio

Hi all.
I turn to you because I am really desperate.
A few years ago I decided to make a video game with the RPG Maker MV program. After finishing it, I decided to make a version for Android.
It should be noted that I am not a programmer nor do I want to publish my game, it was just for me and my friends to play.
The fact is that, after many attempts, in the end, based on trial and error, I managed to make the Android version with Android Studio.
From time to time, I have been correcting an error or bug that has appeared in my game and, to do so, I would redo the entire Android Studio thing. Once the apk was created, I downloaded it to my mobile phone, clicked on it and a message appeared saying "Do you want to install this update? No data will be lost". I gave him to accept, he settled in and everything went great.
However, yesterday, wanting to release a new update, I updated Android Studio. Initially there was no significant change. The apk was created without any problem, I downloaded it and when I clicked on it, it asked me the usual question. However, while the installation bar was filling up, a message appeared: “Application not installed. There is a conflict between the package and another package with the same name."
I've been reading somewhere that this is because I changed a signature of something, but as I said, I'm not a programmer. I have done this update as I did the others, exactly the same, so I don't know the reason. It's probably silly to change a word somewhere, but again, I'm not a programmer and would need someone to help me step by step.
If needed, I can describe step by step how I do the updated apk, if that helps.
Many thanks to all!
 
With each new release of your app you need to increase the "versionCode" and "versionName" in the build.gradle file.

Examples:
versionCode from 1.0 to 2.0
versionName from 1.0 to 1.1

You can increment as much or as little as you'd like as long as both increase.

One other reason could be that you signed the app with a different key. You can avoid this by creating a "debug apk" instead of a "release apk". This would be ok since you're not distributing the app outside your circle of friends.
 
  • Like
Reactions: mikedt and Dannydet
Upvote 0
With each new release of your app you need to increase the "versionCode" and "versionName" in the build.gradle file.

Examples:
versionCode from 1.0 to 2.0
versionName from 1.0 to 1.1

You can increment as much or as little as you'd like as long as both increase.
Thank you very much for answering so soon!
I tried to do this that you told me, but the result was the same :/

One other reason could be that you signed the app with a different key. You can avoid this by creating a "debug apk" instead of a "release apk". This would be ok since you're not distributing the app outside your circle of friends.
I think the problem is going to be a signature problem, but I think I have not signed anything.

I have done screenshots of each step, so you can see how the APK created.
This apk would be version 1.7, I keep version 1.6 and I keep other versions with all folders and files, as far as we can find out something about the signature.


Below I indicate, with images, as I do the APK:
First I open Android Studio and select "Open":
I select this file:
I have always selected that file to do the different versions, so the problem is not here.
When all load, I try to create "Assets Folder", but it does not allow me:
So I addressgo to build.gradle and change 14 by a 16:
And select Sync Now:
With this, it already allows me to create "Assets Folder":
I select "Finish":
And then I go to the folder of my video game (www) and select "Copy":
And I paste on "Assets Folder":
I select "OK":
I wait a little (it takes a few minutes) and then I go to "values.xlm", where I change the name of the App and I name it "FFTCL" (I have always named it like this):
After this, I delete the folders that contain the icon of the App:
Y hago "Image Asset":
I change the Layer Name by Foreground Layer and Background Layer:
And I name it "app_icon":
And "app_icon_round":
I select "Finish":
And 4 folders are created:
I return to "build.grade" and change applicationid and versionName:
And I select Sync Now:
I have always put applicationId "com.fftcls.fftcls" and in versionName I have been adding a number (1.5, 1.6 ...), in this case 1.7
I have never changed versionCode, but yesterday I did it, as you told me, but it did not work.
Finally, I select "Make Project".
I await a few minutes and the APK is created.

I have always followed this method. Then, I downloaded the apk on my phone, installed it and the following notice came out: "Do you want to install an update of this application? Your existing data will not be lost. It does not require any special process". I selected "Install", the application was updated and everything was great.
Now, after selecting "Install" another message appears: "App not installed. The package conflicts with an existing package by the same name."
If I uninstall version 1.6, version 1.7 is installed, but I lose the saved game.

I am very grateful that you have decided to help me ^^
 
Upvote 0
Your build method is completely different from mine. I usually go through about 3 clicks in the build menu and then an upload to the play store and I'm done. Your method seems much more involved than mine.

I do believe you have a signature conflict. I'll point you to this link where there's some troubleshooting for this issue.
https://stackoverflow.com/a/19960210
 
Upvote 0
Your build method is completely different from mine. I usually go through about 3 clicks in the build menu and then an upload to the play store and I'm done. Your method seems much more involved than mine.

I do believe you have a signature conflict. I'll point you to this link where there's some troubleshooting for this issue.
https://stackoverflow.com/a/19960210
The problem is in the conflict of signatures, without a doubt.

However, I think the problem is the following:
From version 1.0 to version 1.6 I had no problem.
Before I made version 1.7, I uninstalled and reinstalled Android Studio.
This would cause me to lose my signature.

On the other hand, I never created a signature, so I don't know how I signed previous versions.
Maybe Android Studio created an auto signature?

I keep previous versions with all the data, would it be possible to obtain the signature of any of them?
 
Upvote 0
The problem is in the conflict of signatures, without a doubt.

However, I think the problem is the following:
From version 1.0 to version 1.6 I had no problem.
Before I made version 1.7, I uninstalled and reinstalled Android Studio.
This would cause me to lose my signature.

On the other hand, I never created a signature, so I don't know how I signed previous versions.
Maybe Android Studio created an auto signature?

I keep previous versions with all the data, would it be possible to obtain the signature of any of them?
If you don't create a signing key, android studio uses a default debug key which it stores in its own directory on your PC. If you reinstalled AS you most likely lost that key.

On windows the debug key is stored here:
C:\Users\<user>\.android\debug.keystore

I don't know any way around this. Going forward, create a key and store it somewhere safe and use it for all future apps and updates.
 
Upvote 0
Didn't you generate the apks through the menu item of 'Build - Generate Signed Bundle / APK' in Android Studio? Here you need to specify your key or create a key to sign the apks.

In general, to release a new version, you should increase the versionCode(an integer value). The Android system uses the versionCode value to compare versions of the same app (with the same package id).
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones