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!