The application does not install a second time

55
January 11, 2019, at 10:40 PM

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

Then again, install the same APK does not work.

Maybe someone came across this, tell me?

Answer 1

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

READ ALSO
How do you debug android platform source code?

How do you debug android platform source code?

When you have issues with android source code, how do you dig into the code? For example for this issue I saw from the debugger that the CookieManager is AwCookieManagerSo from Google search I found that the setCookie is the following:

74
How to limit multiple image selection from the gallery?

How to limit multiple image selection from the gallery?

I have implemented adding multiple image selection from the gallery in my projectHowever, I want to limit the user so he/she can select only 3 images from the gallery

32
How to put image on google map using groundoverlay in android where image having 5k (width)* 5k (height) and 1.6 mb of size?

How to put image on google map using groundoverlay in android where image having 5k (width)* 5k (height) and 1.6 mb of size?

I wanna put an image of my city which contains roads and homes on google map using groundoverlay method in android, where my image size and dimensions are very largeHow I can put this image on map in android?

39
Recycler view is not updating on realtime update

Recycler view is not updating on realtime update

i am trying to update recycler view when the user sends and removes friend requesti am using firebase firestore

48