Reputation: 1700
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?
Upvotes: 39
Views: 26492
Reputation: 93
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
}
}
Upvotes: 0
Reputation: 5304
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
Upvotes: 0
Reputation: 11
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.
Upvotes: 1
Reputation: 3194
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.
Upvotes: 4
Reputation: 141
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!
Upvotes: 2
Reputation: 2488
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 :
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
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.
Upvotes: 13
Reputation: 806
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.
Upvotes: 1
Reputation: 91
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)
Upvotes: 9
Reputation: 44813
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.
Upvotes: 2
Reputation: 571
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.
Upvotes: 2
Reputation: 83
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.
Upvotes: 3
Reputation: 1
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.
Upvotes: 0