Cannot install signed apk to device manually, got error “App not installed”

我只是一个虾纸丫 提交于 2019-11-26 06:18:01

问题


I\'d like to publicate my app to GooglePlay but first i would like to do a last testing with the signed apk to ensure that all of the used API keys are working correctly with the release version (GMaps, Facebook, etc)

So i just made a signed version of my app with our release key and when i try to install the app to the device i got an error:

I have tried to copy the apk to the device and install it with an apk installer app.

Strange thing is when i do the same process with debug signing key, all is well, I can install and run the app.

Here are the steps of the procedure:

I select the release key, type password.

I do select release build type instead of debugging

Just in case i also defined in the gradle file the signing keys but I must admit i dont know is it necessary.

I tried like 7 seven times now so i assume this problem is not just a mistyped password, also I can make this work with the standard debug android signing key.

Please help if you can.


回答1:


You may be using the android 5.0 or above device.

Just go to the Settings --> Apps --> Click on your App. ---> In App info page at the action bar menu there will be an option called " Uninstall for All users " click that. Your app will be completely uninstalled and now you can try installing the new version with no issue. Hope this will help you

Check my solution from below link.

Link 1

Hope it will help you.




回答2:


For Current Updated Android Studio 2.3 users this answer is for you as hardly people use eclipse nowadays for Android development as Android studio has huge advancements.

So, Follow this way to create your Signed apk file.

  1. Build > Generate Signed apk.
  2. Create Keystore path.
  3. Put Password, alias, key password.
  4. Build type select accordingly(eg to release in playstore use release).
  5. Signature Version select both V1 and V2 checkboxes.
  6. Finsih.
  7. Go to from explorer where you selected for the apk to store and you will see your .apk file name as app-release.apk use it.



回答3:


selecting Signature Version v1 and v2 both solved the problem for me....try it




回答4:


The same thing happened to me, as long as I generated my apk from Build> Build APK. I could install and un-install the apk as many times as they were without any problem, but instead if I generated the Build> Generate Signed APK, when I passed the apk to the phone and try to install it, it only allowed me one occasion, the same one that came out the following message:

until then everything was fine if I selected "INSTALL IN ANY WAY", but what happened if I uninstalled the app and wanted to reinstall it (a possible scenario), the following happened:

so I solved the problem by disabling play protect, which I achieved (within Google Play)> Menu> Play Protect> Search for security threats (disable).




回答5:


"App not installed" shows when an app with same package already installed in same device. just delete your first application which you were using for testing purpose before making it to signed apk. This will work. cheers!




回答6:


Select both Signature Version v1 and v2 will resolve the issue

v1 scheme

A JAR file can be signed by using the command line jarsigner tool or directly through the java.security API. Every file entry, including non-signature related files in the META-INF directory, will be signed if the JAR file is signed by the jarsigner tool. For every file entry signed in the signed JAR file, an individual manifest entry is created for it as long as it does not already exist in the manifest

V2 scheme

v1 signatures do not protect some parts of the APK, such as ZIP metadata. The APK verifier needs to process lots of untrusted (not yet verified) data structures and then discard data not covered by the signatures. This offers a sizeable attack surface. Moreover, the APK verifier must uncompress all compressed entries, consuming more time and memory. To address these issues, Android 7.0 introduced APK Signature Scheme v2

By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app using both APK Signature Scheme v2 and the traditional signing scheme, which uses JAR signing.

It is recommended to use APK Signature Scheme v2 but is not mandatory. please see the details




回答7:


Above shubham soni answer works for me,actually it happens to android version >=5.0.In above you able to install just use this while creating your apk...




回答8:


Here I resolved this issue

The reason behind this issue is, there is already an application with the same package name in the phone, but you cannot find it in phone menu(U already made the un-installation but actually its still in your phone).

To see the application go to phones SETTINGS -> APPS. There you can see the application, but inside that the UNINSTALL button may be disabled. click on the menu overflow button to see Uninstall for all users.

After performed uninstalled for all users I have successfully installed my signed apk. You can also use adb to uninstall the app from phone.

adb uninstall package name

In addition to this, if your mobile supports multiple users then check if respective app is not installed for other users. If it is installed for others then first uninstall previous app and try again




回答9:


It's quite old question, but my solution was to change versionCode (increase) in build.gradle




回答10:


That may because you run APK file from external SD card storage. Just copy APK file into internal storagem problem will be solved




回答11:


Go To Build.Gradle(module:app)

use this - minifyEnabled false




回答12:


minifyEnabled false

is the only that worked for me after 3 days of research on all forum!




回答13:


In Android Studio 3.0 and Above

As described here

Note: The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build Bundle(s) / APK(s) > Build APK(s).

Add android:testOnly="false" inside Application tag in AndroidManifest.xml

Reference: https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html




回答14:


This can happen due to your choice of the signature version. On some phones, installation errors occur if the signature version was selected as V2. So if that happens, try selecting V1, it will surely work.




回答15:


if Your Android Studio Version Greater than 3.0

Looks like we can not directly use the apk after running on the device from the build -->output->apk folder.

After upgrading to android studio 3.0 you need to go to Build -> Build Apk(s) then copy the apk from build -> output -> apk -> debug




回答16:


File > Project Structure > Build Variants > Select release > Make sure 'Signing Config' is not empty > if it is select from the drop window the $signingConfigs.release

I did this with Android Studio 3.1.4 and it allowed me to create a release apk after following all the steps above of creating the release apk and release key and adding the info to the app gradle. Cheers!




回答17:


I was face same issue in my android application. I did just update some library and then create sign APK. Now its work.




回答18:


I faced the same issue today, I remembered that I signed my apk with the "new" Google Play signing:



Make sure if you signed your application with Google Play signing.

If you did:

  • Install an update by uploading your apk to Google Console (like you usually would when updating your application):


  • After it has successfully uploaded, open the Artifact library in the menu.
  • You will see the apk you have just uploaded.
  • Press the download button and select Download derived APK.

You will now be able to install the apk.



来源:https://stackoverflow.com/questions/34265897/cannot-install-signed-apk-to-device-manually-got-error-app-not-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!