39

I'm using the Firebase app distribution service for the Android platform. For automatic distributions, I've set up the Gradle file according to the steps mentioned in the docs. The setup and auth are successful. The distribution is also successful. But once I download the app using Firebase's App Tester app for Android, it results in app not installed error. This is for both: debug as well as release variant.

I tried installing the app after disabling the Google play protect, but the issue remains. Can someone please help me regarding this?

enter image description here

enter image description here

enter image description here

enter image description here

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
mumayank
  • 1,670
  • 2
  • 21
  • 34
  • I'm voting to close this question as off-topic because it should be addressed directly to Firebase support. https://support.google.com/firebase/contact/support – Doug Stevenson Sep 27 '19 at 06:08
  • 11
    @DougStevenson As this service is released yesterday, there may be many developers out there facing the same issue. I'm into Android app development for 4 years now, and I have taken best care of all other aspects of the app. The app not getting installed on multiple devices in any build variant is concerning. Also, an answer by a Firebase team member here will help all the developers facing this issue. I request you to kindly do not close this question please. – mumayank Sep 27 '19 at 06:14
  • Thanks for the feedback. I have followed your suggestion: https://www.reddit.com/r/Firebase/comments/d9wmjm/using_firebase_app_distribution_service_is/?utm_source=share&utm_medium=web2x – mumayank Sep 27 '19 at 06:52
  • Throwing my guess into the ring: is there a chance you’ve got the application already installed with an incompatible version? – technoplato Sep 27 '19 at 17:22
  • As I've commented on the answer by @JamesWatson, nopes. – mumayank Oct 02 '19 at 18:26

12 Answers12

10

The reason of the message "Installation Failed" or "App not installed" can vary, simply because this is the only error you can get while installing your app. I agree that it is not helpful.

However, it is for most cases due to a signing issue. Here are some solutions :

  1. Make sure you used a Release Signed APK for your Firebase Distribution. https://developer.android.com/studio/build/build-variants#signing

enter image description here

  1. When you generate your signed APK, you can choose V1 or V2 signatures. Try using the V1 signature. V2 signature was a feature introduced in Android 7.0 : https://developer.android.com/about/versions/nougat/android-7.0#apk_signature_v2

  2. Make sure your app is signed correctly, by checking the values in your file, app/build.gradle :

    android {
       ...
       defaultConfig {...}
       signingConfigs {
           release {
               storeFile file("myreleasekey.keystore")
               storePassword "password"
               keyAlias "MyReleaseKey"
               keyPassword "password"
           }
       }
       buildTypes {
           release {
               ...
               signingConfig signingConfigs.release
           }
       }
    

    }

Last but not least, make sure that your phone has enough storage to install the app, and that the option "Install from unknown sources" is checked in the settings.

Jack'
  • 1,722
  • 1
  • 19
  • 27
9

I ran into this issue with a customer and it turned out that she needed to delete the version of the app that was on her phone to get this to work. (It was a previously installed non Firebase version)

Jonathan
  • 91
  • 1
  • 3
  • 5
    I've run into this before, but I currently have a situation where this does not resolve the problem. – Bill Mote Jul 13 '20 at 12:22
  • @Jonathan I've run into this now, I already uninstalled the debug version and still got this error when installing the release version from Firebase App Distribution and I still have no idea what the problem. – MNFS Sep 20 '22 at 02:24
4

As for my case, when I did ./gradlew appDistributionUploadDebug, it just grabbed whatever APK file it found and uploaded it. In other words, it just uploaded a portion of the app that happened to be there, which was significantly smaller than what it should have been.

./gradlew assembleDebug; ./gradlew appDistributionUploadDebug solved the problem.

solamour
  • 2,764
  • 22
  • 22
3

I had the same issue. So I checked the logs and found this when the installation failed:

2019-10-07 10:20:29.941 771-2406/? E/ResolverController: No valid NAT64 prefix (114, <unspecified>/0)
2019-10-07 10:20:30.740 1278-1537/? W/NativeHelper: Failure copying native libraries [errorCode=-113]
2019-10-07 10:20:30.740 1278-1537/? E/PackageInstallerSession: Commit of session 392193568 failed: Failed to extract native libraries, res=-113

So I assumed there had to be something wrong with my APK-file I used. I pressed Build -> Build APK(s) and uploaded that file to Firebase when it was done. I'm not sure I actually went through the build process the first time or just grabbed the apk directly from the build folders. It may have been corrupted or just the wrong one. I recommend just doing the steps one more time and make sure you build the correct one and upload that.

denlig
  • 83
  • 7
2

Make sure you are providing a signingConfigs to each of your variants.

add to your app's build.gradle's android tag the following code:

signingConfigs {
    config {
        keyAlias '<YOUR_ALIES>'
        keyPassword '<YOUR_KEY_PASSWORD>'
        storeFile file('<YOUR_KEY_PATH>') // Usually use '../keystore.key'
        storePassword '<YOUR_STORE_PASSWORD>'
    }
}

Finally, add the following line into each variant in your buildTypes in your app's build.gradle :

signingConfig signingConfigs.config

Hope this helps.

orimen
  • 571
  • 4
  • 11
  • This is the correct answer here. You don't want your QA/internal testers to need to uninstall each time. Simply sign the distributed version with your current keystore file or a new one - it doesn't matter. – em_ May 07 '20 at 16:02
  • For flutter users signing the app using this https://flutter.dev/docs/deployment/android worked for me – Gridcell Coder Jun 13 '20 at 22:37
2

This is a random error (apparently).

What worked for me was manually deleting the build folder inside the app module (simply cleaning the project does not delete all the compiled code), build the APK again, re-upload it on FAD and then the APK installed successfully.

MatPag
  • 41,742
  • 14
  • 105
  • 114
2

The reason this happens is that the APK that you generated may not be compatible with all mobile CPU architectures. By CPU architectures, I mean that some APKs are compatible with only ARM or x86 Android devices. Therefore, there is a tag within the app-level gradle file within <project_dircectory>/android/app/build.gradle called universalApk which has to be set to true so that when you generate the APK from either android studio or from the CLI, it will generate for you a universal APK, compatible with all CPU architectures and therefore, multiple Android devices regardless of which CPU architecture that Android device supports.

The parameter universalApk can be found specifically in the splits JSON object with the build.gradle file aforementioned like so:

splits {
        abi {
            reset()
            enable enableSePerCPUArchitecture
            universalApk true  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }

You can also customize, as you see in the same JSON object, the different CPU architecture you would like to include to separately support when generating an APK. In this case, I have included: "armeabi-v7a", "x86", "arm64-v8a", "x86_64", which means when I undergo the APK generation process, a separate APK will be generated for each of these CPU architectures (which is useful is you only want to support specific android devices and reduce the size of the APK).

Evidently, one downside of using a Universal APK is that the size of the apk will be substantially larger than the individual architecture APKs, simply because we are accommodating multiple Android devices.

In summary, this is the solution I found because initially, I had only uploaded the x86 APK, which produced the same error on my Android device because it was not x86 compatible. As soon as I generated a universal release APK via Android studio, and invited myself to test the app on my Android device using Firebase App Distribution, it worked smoothly!

Farhan Kassam
  • 121
  • 1
  • 2
1

After trying all of the other solutions, it turned out that the problem in my case was that there wasn't enough available storage space - the package installer gives a generic "Install failed" in this case too. Hopefully this saves someone else the hours I wasted.

user1405990
  • 806
  • 1
  • 8
  • 19
1

I have ran into this issue. This might be due to lack of sufficient space on the phone's internal storage. I tried freeing up some space and then installed the app. This worked for me.

Raj Shekar
  • 11
  • 1
0

We ran into this error when having the production build of our application available on the devices in question.

Simply uninstalling the production app worked a charm - we could then install either our test/dev/both applications without any issues.

  • 1
    Thank you for the response. But no, I don't have the app already installed on the target device. – mumayank Oct 02 '19 at 18:25
  • I had a similar issue. There was previous snapshot version installed and while updating the app via App Tester I've got the meaningless: Installation Failed error. In my case I had to do two steps: uninstall previously installed app AND reboot the phone. Next, I was able to update the app via App Tester. – iaforek Aug 31 '21 at 07:51
0

For me, bitrise had an issue with the ANDROID KEYSTORE FILE in code signing. Somehow, the keystore password, alias, and private upload key were missing.

Going to workflows -> code signing -> android keystore file and re-entering the values made it work

Jordan Daniels
  • 4,896
  • 1
  • 19
  • 29
0

For me the debug apk does not work with Firebase App Distribution but release apk does work. You can disable proguard in build.gradle file:

buildTypes {
    release {
        minifyEnabled false
    }
}
Robin Sun
  • 93
  • 1
  • 2
  • 9