Search code examples
androidandroid-studioapkandroid-install-apk

Trouble installing release Apk


I am new to Android studio. I just finished making an app. I made a signed release Apk and I can install it on my phone and some other phones, but I can't install it on many other devices.

here is what I did in detail:

  • from "build variant" menu, I chose "release". (as it is written here: https://stackoverflow.com/a/30586280)

  • I created my APK using build > Generate signed bundle/apk and used my keystore.

  • for signature version, I chose both options (V1 & V2)

  • the APK was created successfully.

  • I copied this APK to several devices: a Huawei Y7, a Huawei honor 6, a Motorola moto G5 plus, a samsung J7, and a Nokia 3. (I used huawei Y7 during developement for debugging. Moto G5 plus and Samsung J7 belong to my friends and I sent them the APK file using email.)

  • the APK was successfully Installed on Nokia 3 and Huawei Y7 and my app worked fine (as I expected)

  • I wasn't able to Install the APK on Huawei honor 6 and Samsung J7. I got an "install failed" message from android package Installer.

  • on the Moto G5 plus, I successfully Installed my App but it stopped working before even the main activity showed up.

  • I connected the Huawei honor 6 to my laptop and was able to install the APK via USB Debugging and the app worked fine, as I expected. but I still couldn't install the app on this device Using the signed APK that I created using android studio.


Solution

  • I solved this issue by adding this in my build.gradle (app) file:

        splits {
            abi {            
                enable true
                universalApk true
            }
        }