The application does not install a second time - android

I sign the APK, I choose the type of Debug, I distribute it directly, I will not upload it to Google Play.
I install. But the problem is that I try install the same APK back, it does not install writes.
1) I tried to delete, delete for all users and again, all in vain. One version helps, I raise version code to 2, version name to 1.1, sign and roll back this data and sign again. Only then installed.
2) Disabled “Check security threats” on Google Play, and works fine
3) Even if you put it on Google Play in closed testing and from there download the APK and install, the problem disappears
Then again, install the same APK does not work.
Maybe someone came across this, tell me?

If you are using ADB, you need to use the -r flag,
here is the docs: https://developer.android.com/studio/command-line/adb
Here is the command:
adb install -r path_to_apk
When installing from a downloaded file the versionCode always needs to be higher than the one currently installed to allow for a new installation.
versionCode — A positive integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName setting, below. The Android system uses the versionCode value to protect against downgrades by preventing users from installing an APK with a lower versionCode than the version currently installed on their device.
The value is a positive integer so that other apps can programmatically evaluate it, for example to check an upgrade or downgrade relationship. You can set the value to any positive integer you want, however you should make sure that each successive release of your app uses a greater value. You cannot upload an APK to the Play Store with a versionCode you have already used for a previous version.
Reference: https://developer.android.com/studio/publish/versioning

find the project in Your projects_folder for example
and go into your Project which is not install........
go into the gradle/.....and find the apk folder and delete it
MyComputer/D/Newfolder/.....
2.go into the gradle/.....and find the apk folder and delete it
3.After all run project again

Related

In Google Play, it says "You need to upload an APK or Android App Bundle for this application"

I'm on the review summary after my apk was uploaded. It says,
Errors
Resolve these errors before starting the roll-out of this release.
You need to upload an APK or Android App Bundle for this application.
You cannot remove all production APKs and Android App Bundles.
I've looked at various sources and am not sure what the solution is.
As you can see from the first screenshot you are deactivating your first APK (version code 1). But you haven't uploaded a new version of your APK. You can't do a release without any APKs live. You have two choices:
reactivate your old APK (Press the "Retain" (Now it is renamed to Include) button by the version 1 APK)
upload a new APK
I assume you know what you want to do.
This seems like a code version issue. update the code version 1 to 2.
check into your manifest file:
android:versionCode="8"
and increase it,
that was the problem by me.
Just discard the earlier release and add new one, the issue would be resolved.
Oh man! you are adding a second release or second version of the android app see your screenshot it says apks to be deactivated ..
see in that image actually you are deactivating the earlier version so just go to above button BROWSE FILES
https://i.stack.imgur.com/aNF1C.png
Click BROWSE FILES and then select your apk file....
Now make sure that you are selecting a version 2 apk i mean not the same which you are deactivating that was version 1 or earlier version
You need to upload an APK or Android App Bundle for this application.
You cannot remove all production APKs and Android App Bundles.
It means that you have not selecteed any apk till now so just click BROWSE FILES and select apk file and you have to change the version also because you are adding a another version
look closely at your image
and for changing the version go to
Build gradle file of your app and see the version number you have to increment that by 1 or any positive quantity... increment only the version no decrement
see Version written there Version name "1.0" change it to "2.0" and versioncode 1 to 2
because now playstore wont accept your earlier version apk i.e 1 it wil only accept incremented version like 2 3 or 4 etc
I figured out the problem (and yes I activated the APK beforehand as well). I didn't change the package name entirely in my .xml file. Once I did, I rebuilt my APK and it worked.

"App not installed" message when installed apk

So I have an app on the Play Store that I released about a week ago. I've done a ton of work to to it since and I'm basically going to rebrand it a bit.
When I first released the app, I put it up on the app store with the name "First Name of App" (obviously not the correct name). I now have an update ready to publish with a lot of changes, and one change is that the app name is now "Second Name of App". It's all under the same package yet, I just changed the name using the Manifest.
I'm having an issue though with testing. Currently on my own phone, I have the version of the app that is currently on the Play Store installed.
I generated a signed APK using Android Studio (all with the same settings and key passwords and such). I then put that signed apk on my phone for testing, and when I try to install it I get the "App not installed" message.
Things I have tried:
Uninstalling the previous APK and then installing the newer version. If I uninstall the Play Store version first, and then install the newer signed APK version, it installs fine. The problem with this though is that I lose the data that I had in the Play Store version. I can't have that.
Changing the "versionCode" and "versionName" numbers in the build.gradle. I made sure both numbers are higher than what the Play Store version is, but I still get the same "App not installed" message.
Making sure the settings while generating the signed APK are the same. All of the settings are exactly the same. The signature version checkboxes are both checked yet also, as they were with all previous versions.
Anyone have any ideas what could be going on? I really would like to release this update but I'm afraid if I just upload this signed apk to the store that everyone would have the same issue, and that they'd be forced to uninstall the current version they have (resulting in data loss).
The problem seems that you are trying to install an APK with the same package name but different key and that creates a conflict. Android only considers an App to be the same if both package name and key signature are identical.
Keys are unique, even if you use the same settings and passwords each time you create a key a new unique key is created and it will be always different to the key you used in the Play Store release.
The only way to install the APK is to uninstall the Play Store version.
And that serves to emphasize how important it is to keep the key used in the Play Store, if you lose it you will not be able to upload new updates.
UPDATE
If your have "Google Play App Signing " activated for you app, the key used when an user installs the app from Play Store is different than the one you used to upload the release to the Play Console.
https://support.google.com/googleplay/android-developer/answer/7384423?hl=en
Have you by chance changed the minimum SDK version or anything like that? I've had a similar issue. I've an app on the PlayStore which I tried upgrading with an APK with the same signature as that of the PlayStore version but a different minimum SDK version. When I tried installing I get the 'app not installed' error. I then uploaded this APK on the PlayStore. On my device, the app on the PlayStore now shows two options 'Uninstall' and 'Open'. Due to your conflict, users will have to first uninstall the app and install it again. There will be no 'Update' option due to the conflict. Hope this helps :)
Similar Issue
Android Phone: Google Pixel3, Android 9
install youtube apk, but error:
Application Not Installed = App Not Installed
Final Solution
use adb's pm to install apk
even same error, but can show/known the fail reason
then can find specific solution to fix it
Examples
here later encounter many error cases:
blueline:/storage/emulated/0/Download # pm install /data/local/tmp/com.google.android.youtube_16.29.36.apk
pm install /data/local/tmp/com.google.android.youtube_16.29.36.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
or:
blueline:/data/local/tmp # pm install youtube_16.29.36_addedDebuggable.apk
pm install youtube_16.29.36_addedDebuggable.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl445467286.tmp/base.apk: Attempt to get length of null array]
then google it and find specific solution to fix it, install apk successfully.

Android: updating apk from outside Google Play with greater versionCode

Android documentation says it is important that versionCode parameter is greater on a new apk than the old one when uploading a new release to the Developer Console, but it says also that versionCode is not really enforced on the system, if I am not wrong.
Here: http://developer.android.com/tools/publishing/versioning.html
Does it mean I could distribute newer apk files (not beta versions), let's say, on a web-site while the one on Google Play is updated less frequently (by my choice) without any problem?
The device won't let you install an application with the same package name as an existing application unless the new version code is greater than or equal to the existing version code.
So yes, you can have version 1 on your device and the Play store, then distribute newer apks with version code 1,2,3,4. Then the next apk uploaded via the console must be 5 to allow devices with code 4 to install it.
As you say you have two apk's.
Let suppose that we have
A.apk (versionCode = 40) - downloaded from Google Play. Installed on user device.
A.apk (versionCode = 41) - located on your website.
In this case you can send to your customers link to update your application. As you know Google Play waste some time to check your app, so
if you push 41 version in GooglePlay you will have next scenario :
User have application with versionCode = 40.
You send notification/link for update
You push 41 version into Google Play
User download 41 version and install it.
After Google check your app you dosn't receive any messages for update.
So, roll-back to your answer
- Does it mean I could distribute newer apk files (not beta versions), let's
say, on a web-site while the one on Google Play is updated less frequently
without any problem?
- Yes.

How to update an Android app programmatically

I have developed an app for Android. When I installed it for first time, the app works. But when I do some changes in source code, we cant install it without deleting it from phone. I want that app should be updated wen I install it for second time. Any solutions?
Note: My app consists of database which I don't want to delete so want to update new app on existing one
Change your VersionCode in your Android Manifest to subsequent versions
android:versionCode
android:versionCode — An integer value that represents the version of
the application code, relative to other versions. The value is an
integer so that other applications can programmatically evaluate it,
for example to check an upgrade or downgrade relationship. You can set
the value to any integer you want, however you should make sure that
each successive release of your application uses a greater value. The
system does not enforce this behavior, but increasing the value with
successive releases is normative. Typically, you would release the
first version of your application with versionCode set to 1, then
monotonically increase the value with each release, regardless whether
the release constitutes a major or minor release. This means that the
android:versionCode value does not necessarily have a strong
resemblance to the application release version that is visible to the
user (see android:versionName, below). Applications and publishing
services should not display this version value to users.
See this http://developer.android.com/tools/publishing/versioning.html
How you are installing the application if by connecting usb you are trying so the new application will install and you can uninstall the first application and install the updated one so the new application will run perfectly.
Well, if you have compiled your second version you want to replace the old one...
I don't know what are you using to program for android, but if you use eclipse sdk that is done automatically..
The problem is probably because of your keystore with that you export your application. If you export your app with the default Android keystore, and then if you change the app on another PC and export it again with the default keystore on that other PC and install it on the same device, the Android will see that you have 2 same apps but with different keystores. That's why you need to first unistall the app and install it again.
It doesnt matter if you use the defualt Android keystore on both PC-s. They still aren't the same keystore.
One solution is that you create a keystore eg. ProjectKeystore and you create a folder keystore in your project. Put the keystore in that folder, and maybe put a file with the keystore username and pass. With that you can use the same keystore when you export your app on any PC.
But if you change version code then you will be prompted with this error. So Try looking for keystore
Re-installation failed due to different application signatures.
ExpenseTracker] You must perform a full uninstall of the application.
WARNING: This will remove the application data!
ExpenseTracker] Please execute 'adb uninstall com.spundhan.expensetracker' in a shell.
I have had similar problems trying to install my apps on occasion. To solve the problem I went to the app management screen and told the program to stop running then my update installed properly. I think it has something to do with the way android handles the program lifespan. When you exit a program it doesn't always stop running. If there is an error in something then android can have a problem closing the program before it can update it.

Android APK file: Re-activate older APK file in Google Play Store

I have uploaded two APK files into the Google Play store. One is a newer version and one is an older version. The newer version is the active one since it has a higher versionName and Code. Now I found some bugs in the newer version and I want to delete it from the Play Store and activate the older version. Google Play won't let me deactivate the newer one and activate the older one again, since it has a lower versionName and code.
The problem is that I'm am not the developer and did not build the app. The developer is in another country and it is difficult to get hold of them.
What can I do to reactivate the older version again? I know one solution would be to change the versionName and Code. I only have the apk file, can I change those details in Eclipse with only the apk file and very little experience in eclipse or developing android apps?
Thank You
You can't rebuild a new version of an apk from the apk itself.
Have the app developer do the following:
Rebuild project in its previous state with higher version number (must be higher than all previously submitted versions)
Resubmit
From Google's Android "Developer Console" page:
Note that rollbacks aren’t supported due to the app versioning
requirements of the Android platform. If you need to rollback,
consider launching a previous APK with a new version number. However,
this practice should be used only as a last resort, as users will lose
access to new features and your old app may not be forward-compatible
with your server changes or data formats, so be sure to run alpha and
beta tests of your updates.
A good strategy is, when creating a build, modify the manifest to build say a version 2.0 = 39 AND again 2.05 = 45 and generate these two apks which will obviously do the same thing.
Later, when build 2.01 = 40 is in production and you find an error, you can jump back to the old version by uploading the 2.05 = 45 you created earlier.
You have 5 opportunities to back track while releasing 40, 41, 42, 43 and 44 to go back to earlier functionality!
Do this for each build and you can always go back to an earlier version which has been pre compiled and built but with a higher version number than currently in production.
You will not be able to change the APK file without having the signing certificate.
You should be able to revert to an older version, assuming you didn't change the level of API support.
Presumably, go to the Dev console, select the APK tab, hit the "Advanced Mode" option, deactivate the current version and hit "Reactivate" for the version you want.

Categories

Resources