My app uses Firebase and Flutter (auth, cloud_firestore, google_sign_in...).
And when I upload it to Play Store with App Bundle using this command:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
My app does not work properly with Firebase, there are no logs and crash reports.
But when I use APK it works.
So I released several APK files using this command: flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi, my question is is it possible to upload those 3 files to the same app on Play Store?
It gives me a warning too:
Unoptimized APK
Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices.
Resolution:
Use the Android App Bundle to automatically optimize for device configurations, or manage it yourself with multiple APKs.
What should I do? (I prefer to use APK because my app works with APK)
packages:
google_sign_in: 4.5.1
firebase_auth: 0.16.1
firebase_core: ^0.4.0+8
firebase_analytics: ^5.0.14
cloud_firestore: ^0.13.6
app/build.gradle (android->defaultConfig) I commented the NDK section because APK doesn't allow with it.
defaultConfig {
applicationId "XXXXXX"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
// ndk {
// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
// }
}
...
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
multiDexEnabled true
}
}
I would not recommend this, 3 strikes and you are out. If you've made a mistake that unintentionally breaches Terms and Conditions and you get one app pulled because of it then you can correct the issue and resubmit but if you have the same issue with all three then they will all be pulled and your account will be banned. This is so easy to do, so I recommend only one at a time, leave it a week between each upload. I had this happen to me when I unintentially left a link to my own app repository, it wasn't even a visible link, but external links were against T&C's at the time and probably still are. They will not talk to you and you have no recourse so be very careful.
This is only a warning to let you know about the size of your APKs being unnecessarily large, this isn't a blocking error. If you can't publish your app, this isn't the reason: make sure you have filled all the store listing (with images), ticked all the boxes, filled in the privacy policy, etc.
You can upload several APKs for the same App as long as they target different architectures. I'm doing the same for my apps. The warning above can be ignored.
Related
My Android app uses a custom native library (written in C++) that I compile for each of the architectures armeabi-v7a, arm64-v8a, x86 and x86_64. The earliest version of Android that supports 64-bit native libraries (arm64-v8a / x86_64) is API level 21 but with the 32-bit native libraries (armeabi-v7a / x86) I'm able to support devices down to Android API level 16.
Due to those differing API levels and because the compiled libraries get quite big I create a specific apk file for each of those architectures. So, eventually I have 4 different apk files which enables my app to run on pretty much every Android device down to API level 16. That approach works and is documented here. My build.gradle file that builds those apk files looks as follows:
android
{
...
defaultConfig
{
minSdkVersion 16
targetSdkVersion 29
...
}
flavorDimensions "abi"
productFlavors
{
"ARM7"
{
dimension "abi"
ndk.abiFilters 'armeabi-v7a'
versionCode 160000 + android.defaultConfig.versionCode
versionNameSuffix "-arm32"
}
"ARM8"
{
dimension "abi"
ndk.abiFilters 'arm64-v8a'
minSdkVersion 21
versionCode 210000 + android.defaultConfig.versionCode
versionNameSuffix "-arm64"
}
"x86"
{
dimension "abi"
ndk.abiFilters 'x86'
versionCode 160000 + android.defaultConfig.versionCode
versionNameSuffix "-x86"
}
"x86-64"
{
dimension "abi"
ndk.abiFilters 'x86_64'
minSdkVersion 21
versionCode 210000 + android.defaultConfig.versionCode
versionNameSuffix "-x64"
}
}
...
}
Now, Google pushes the new Android Bundle format and the documentation currently states
Important: In the second half of 2021, new apps will be required to publish with the Android App Bundle on Google Play. New apps larger than 150 MB must use either Play Feature Delivery or Play Asset Delivery.
So, at some point I will have to convert my multi-apk approach to that new Android Bundle format but I'm essentially clueless how this is supposed to work. While each of my apk file contains its own manifest with its own version number and minSdkVersion an Android Bundle contains one unified manifest.
How would I be able to create an Android Bundle that eventually has the same effect as my 4 existing apk files?
First of all, there is an easier way of achieving what you already have- splits-on-abi (see https://developer.android.com/studio/build/configure-apk-splits). This method handles the versionCode and so forth for you.
As noted on that page- it's better to use app bundles for this purpose now. App bundles have two main purposes- to minify(/optimize) downloads, and to allow for dynamic modules. The first bit makes it so that Google Play essentially takes your huge app-bundle containing everything, and makes a smaller apk containing only what is needed for the particular device that is asking. It is only this minimal apk that is downloaded to the device.
So, to summarize: You upload one big app bundle to Google Play containing everything for all devices. Google Play then builds minimal apks containing only what is needed, and downloads only those to device. Technically speaking, Google play creates an .apks which is downloaded, this is essentially a zip file with multiple .apk files, following this format: but that is mostly just an implementation detail you don't need to worry about.
You can simulate and try out how app bundles work (.aab format) with the bundletool (https://github.com/google/bundletool/releases) which according to Google is what Google Play is using to handle app bundle files.
Also, you can drop the flavors. Those will only get in the way now.
I've just received and read a newsletter from Google Play mentioning that from next year on, the store "will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions".
For those who haven't read it yet, it states:
64-bit support requirement in 2019
Platform support for 64-bit architectures was introduced in Android
5.0. Today, over 40% of Android devices coming online have 64-bit support, while still maintaining 32-bit compatibility. For apps that
use native libraries, 64-bit code typically offers significantly
better performance, with additional registers and new instructions.
In anticipation of future Android devices that support 64-bit code
only, the Play Console will require that new apps and app updates with
native libraries provide 64-bit versions in addition to their 32-bit
versions. This can be within a single APK or as one of the multiple
APKs published.
We are not removing 32-bit support. Google Play will continue to
support 32-bit apps and devices. Apps that do not include native code
are unaffected.
This change will come into effect in August 2019. We're providing
advance notice today to allow plenty of time for developers who don't
yet support 64-bit to plan the transition. Stay tuned for a future
post in which we'll take an in-depth look at the performance benefits
of 64-bit native libraries on Android, and check out the CPUs and
Architectures guide of the NDK for more info.
What practical changes will we need to make to perfectly comply with this new requirement when applicable?
According to an official email sent by the Google Play Team, the action required is:
If you haven't yet, we encourage you to begin work for the 64-bit
requirement as soon as possible. Many apps are written entirely in
non-native code (e.g. the Java programming language or Kotlin) and
will not need code changes.
Please note that we are not making changes to our policy on 32-bit
support. Google Play will continue to deliver apps with 32-bit native
code to 32-bit devices. The requirement means that those apps will
need to have a 64-bit version as well.
To help you make the transition, we've prepared documentation on how
to check whether your app already supports 64-bit and how to become
64-bit compliant.
We're also providing a high-level timeline below.
So, the linked documentation explains:
If your app uses only code written in the Java programming language or
Kotlin, including any libraries or SDKs, your app is already ready for
64-bit devices. If your app uses any native code, or you are unsure if
it does, you will need to assess your app and take action.
[...]
The simplest way to check for 64-bit libraries is to inspect the
structure of your APK file. When built, the APK will be packaged with
any native libraries needed by the app. Native libraries are stored in
various folders based on the ABI. It is not required to support every
64-bit architecture, but for each native 32-bit architecture you
support you must include the corresponding 64-bit architecture.
For the ARM architecture, the 32-bit libraries are located in
armeabi-v7a. The 64-bit equivalent is arm64-v8a.
For the x86 architecture, look for x86 for 32-bit and x86_64 for
64-bit.
The first thing to do is ensure that you have native libraries in both
of these folders.[...]
And, to build 64-bit libraries, you basically need to follow the instructions below:
Most Android Studio projects use Gradle as the underlying build
system, so this section applies to both cases. Enabling builds for
your native code is as simple as adding the arm64-v8a and/or x86_64,
depending on the architecture(s) you wish to support, to the
ndk.abiFilters setting in your app's 'build.gradle' file:
// Your app's build.gradle
apply plugin: 'com.android.app'
android {
compileSdkVersion 27
defaultConfig {
appId "com.google.example.64bit"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// ...
Finally, a quick note:
The 64-bit version of your app should offer the same quality and
feature set as the 32-bit version.
By the way, this official video talks a little bit about it.
If you have no native (NDK) code, that is you only write Java/Dex code, then you don't need to do anything.
If you have native code (or libraries) then you need to supply their 64-bit versions.
As per documentation here, if your app is using native code or external library, for example, realm (in the picture below) which is based on native, then a support for 64-bit should be provided. If any of external libraries in your app which uses any C/C++ (native) should have both 32-bit and 64-bit architecture support otherwise you should make contact with the library owner. In Android Studio, we can check whether versions for both architectures are available by Build > Analyze APK and the following window appears:
If you are using NDK and creating native code, you should provide support for all architecture by enlisting them in the gradle as:
defaultConfig {
ndk.abiFilters = 'armeabi-v7a' 'arm64-v8a' 'x86' 'x86_64'
}
If your Android APK is not including 64-bit support, you need not to worry.
Go to Build -> Analyze APK, in Android Studio. You are able to see APK structure. Under lib, if you see armeabi-v7a libraries and if you do not have any arm64-v8a or x86_64 libraries, then your APK does not support 64-bit architecture.
Just go to app level build.gradle and add abiFilters in NDK under defaultConfig as below:
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
Step 1 :
app=> build.gradle (put below code in build.gradle)
android {
........
defaultConfig {
.........
ndk {
abiFilters = []
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
}
........
}
.......
packagingOptions {
exclude 'lib/armeabi-v7a/libARM_ARCH.so'
}
}
Step : 2
gradle.properties
(put below line in gradle.properties)
PROP_APP_ABI=armeabi-v7a:arm64-v8a
Step 3 : Build propject again. Try to upload that apk to play store.
Adding
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
in the build.Gradle file under DefaultConfig. Note that push to play store 64-bit requirement is coming.
I tried this By Official Android Docs. Working Excellent.
In this Solution, I have Build Multi APKs You can see in Attachment...
Make Sure Your Compile Skd Version is 29 or Build Tools Version Is 29.0.3 Written Bellow:
Android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "com.myapp.sk"
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
splits {
density {
enable true
reset()
include "mdpi", "hdpi"
}
abi {
enable true
reset()
include "x86", "x86_64"
}
}
}
// Map for the version code that gives each ABI a value.
ext.abiCodes = ['armeabi-v7a':1, x86:2, x86_64:3]
// For per-density APKs, create a similar map like this:
// ext.densityCodes = ['mdpi': 1, 'hdpi': 2, 'xhdpi': 3]
import com.android.build.OutputFile
// For each APK output variant, override versionCode with a combination of
// ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode
// is equal to defaultConfig.versionCode. If you configure product flavors that
// define their own versionCode, variant.versionCode uses that value instead.
android.applicationVariants.all { variant ->
// Assigns a different version code for each output APK
// other than the universal APK.
variant.outputs.each { output ->
// Stores the value of ext.abiCodes that is associated with the ABI for this variant.
def baseAbiVersionCode =
// Determines the ABI for this variant and returns the mapped value.
project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
// Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes,
// the following code does not override the version code for universal APKs.
// However, because we want universal APKs to have the lowest version code,
// this outcome is desirable.
if (baseAbiVersionCode != null) {
// Assigns the new version code to versionCodeOverride, which changes the version code
// for only the output APK, not for the variant itself. Skipping this step simply
// causes Gradle to use the value of variant.versionCode for the APK.
output.versionCodeOverride =
baseAbiVersionCode * 1000 + variant.versionCode
}
}
}
Multi-Aks Attachment
Native code: refers to an executable program that was compiled directly to the CPU instructions of the computer it is running on.
Non-native code: refers to an executable program that was compiled to the CPU instructions of the original Tandem architecture of the late 1970s and 1980s. When such a program is run, it cannot execute directly on the CPU of the computer it is running on. The NonStop operating system includes an interpreter for that original Tandem architecture, which is used to run such non-native code.
If your app uses only code written in the Java programming language or Kotlin, including any libraries or SDKs, your app is already ready for 64-bit devices. If your app uses any native code, or you are unsure if it does, you will need to assess your app and take action.
Does your app use native code?
The first thing to do is to check to see if your app uses any native code. Your app makes use of native code if it:
uses any C/C++ (native) code in your app.
links with any third party native libraries.
is built by a third party app builder that uses native libraries.
For more, visit the docs.
Option 1 - remove lib from APK.
Step 1 - convert the APK to ZIP and find lib folder; if you have lib folder, see the library dependency.
Step 2 - remove dependency from build Gradle.
Option 2 - Download 64-bit and 32-bit JAR file and add in your lib folder in app and build.
first open build.gradle module app and add these lines in order to remove .so files and add 64 bit liobraries
removing all .so files present in libs of apk
android {
compileSdkVersion 29
defaultConfig {
-----
-----
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions{
packagingOptions {
exclude 'lib/armeabi-v7a/libvudroid.so'
exclude 'lib/x86/libvudroid.so'
exclude 'lib/arm64-v8a/libvudroid.so'
}
}`
In my case, I was using a library (ESRI ArcGIS for Android) that makes use of OpenGL C libraries. Instead of the ndk.abiFilters... string that seems to fix everyone else's issues, I had to use the following:
ndk { abiFilters "armeabi-v7a", "arm64-v8a" }
Add this in your build.gradle
ndk.abiFilters 'arm64-v8a','x86_64'
I'm here with this problem that have me crazy already.
We were uploading APKs with no problem to the store. Suddenly google play changed their rules and now you only can upload APKs with only 64 bits. So we find out which module of our app has 32 bits folders and deleted them. We generated an APK and uploaded it. No problem, no errors, no warnings. BUT now we have a lot of devices that can not download the app, of course. The old ones, and we need them.
So I tried to generate a Bundle to upload, and I did it. But I am having the SAME problem. Here is what I did:
I have an AAR included in the project that was the one with the 32/64 bits problem. So we opened the project of the AAR and deleted the 32 bits folders, generated the AAR again and included again in the project.
Then I generated the BUNDLE and uploaded to the store. No errors, no warnings, no nothing. But the problem that we had before with the apk is still here, old phones can not download the app.
So then I restored the OLD AAR, with re 32 bits folders, and I generated a BUNDLE with this things in Gradle app file:
defaultConfig {
applicationId "ar.com.redlink.vale"
minSdkVersion 16
targetSdkVersion 28
versionCode 80
versionName "3.15.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86'
dimension "default"
}
splits {
abi {
include 'armeabi-v7a','arm64-v8a','x86'
}
}
I tried to upload the Bundle to the store and I get the error that mi files have 32 bits things, so I can not upload it.
I don't know what else to do. Maybe I am not understanding this thing right.
I've just received and read a newsletter from Google Play mentioning that from next year on, the store "will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions".
For those who haven't read it yet, it states:
64-bit support requirement in 2019
Platform support for 64-bit architectures was introduced in Android
5.0. Today, over 40% of Android devices coming online have 64-bit support, while still maintaining 32-bit compatibility. For apps that
use native libraries, 64-bit code typically offers significantly
better performance, with additional registers and new instructions.
In anticipation of future Android devices that support 64-bit code
only, the Play Console will require that new apps and app updates with
native libraries provide 64-bit versions in addition to their 32-bit
versions. This can be within a single APK or as one of the multiple
APKs published.
We are not removing 32-bit support. Google Play will continue to
support 32-bit apps and devices. Apps that do not include native code
are unaffected.
This change will come into effect in August 2019. We're providing
advance notice today to allow plenty of time for developers who don't
yet support 64-bit to plan the transition. Stay tuned for a future
post in which we'll take an in-depth look at the performance benefits
of 64-bit native libraries on Android, and check out the CPUs and
Architectures guide of the NDK for more info.
What practical changes will we need to make to perfectly comply with this new requirement when applicable?
According to an official email sent by the Google Play Team, the action required is:
If you haven't yet, we encourage you to begin work for the 64-bit
requirement as soon as possible. Many apps are written entirely in
non-native code (e.g. the Java programming language or Kotlin) and
will not need code changes.
Please note that we are not making changes to our policy on 32-bit
support. Google Play will continue to deliver apps with 32-bit native
code to 32-bit devices. The requirement means that those apps will
need to have a 64-bit version as well.
To help you make the transition, we've prepared documentation on how
to check whether your app already supports 64-bit and how to become
64-bit compliant.
We're also providing a high-level timeline below.
So, the linked documentation explains:
If your app uses only code written in the Java programming language or
Kotlin, including any libraries or SDKs, your app is already ready for
64-bit devices. If your app uses any native code, or you are unsure if
it does, you will need to assess your app and take action.
[...]
The simplest way to check for 64-bit libraries is to inspect the
structure of your APK file. When built, the APK will be packaged with
any native libraries needed by the app. Native libraries are stored in
various folders based on the ABI. It is not required to support every
64-bit architecture, but for each native 32-bit architecture you
support you must include the corresponding 64-bit architecture.
For the ARM architecture, the 32-bit libraries are located in
armeabi-v7a. The 64-bit equivalent is arm64-v8a.
For the x86 architecture, look for x86 for 32-bit and x86_64 for
64-bit.
The first thing to do is ensure that you have native libraries in both
of these folders.[...]
And, to build 64-bit libraries, you basically need to follow the instructions below:
Most Android Studio projects use Gradle as the underlying build
system, so this section applies to both cases. Enabling builds for
your native code is as simple as adding the arm64-v8a and/or x86_64,
depending on the architecture(s) you wish to support, to the
ndk.abiFilters setting in your app's 'build.gradle' file:
// Your app's build.gradle
apply plugin: 'com.android.app'
android {
compileSdkVersion 27
defaultConfig {
appId "com.google.example.64bit"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// ...
Finally, a quick note:
The 64-bit version of your app should offer the same quality and
feature set as the 32-bit version.
By the way, this official video talks a little bit about it.
If you have no native (NDK) code, that is you only write Java/Dex code, then you don't need to do anything.
If you have native code (or libraries) then you need to supply their 64-bit versions.
As per documentation here, if your app is using native code or external library, for example, realm (in the picture below) which is based on native, then a support for 64-bit should be provided. If any of external libraries in your app which uses any C/C++ (native) should have both 32-bit and 64-bit architecture support otherwise you should make contact with the library owner. In Android Studio, we can check whether versions for both architectures are available by Build > Analyze APK and the following window appears:
If you are using NDK and creating native code, you should provide support for all architecture by enlisting them in the gradle as:
defaultConfig {
ndk.abiFilters = 'armeabi-v7a' 'arm64-v8a' 'x86' 'x86_64'
}
If your Android APK is not including 64-bit support, you need not to worry.
Go to Build -> Analyze APK, in Android Studio. You are able to see APK structure. Under lib, if you see armeabi-v7a libraries and if you do not have any arm64-v8a or x86_64 libraries, then your APK does not support 64-bit architecture.
Just go to app level build.gradle and add abiFilters in NDK under defaultConfig as below:
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
Step 1 :
app=> build.gradle (put below code in build.gradle)
android {
........
defaultConfig {
.........
ndk {
abiFilters = []
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
}
........
}
.......
packagingOptions {
exclude 'lib/armeabi-v7a/libARM_ARCH.so'
}
}
Step : 2
gradle.properties
(put below line in gradle.properties)
PROP_APP_ABI=armeabi-v7a:arm64-v8a
Step 3 : Build propject again. Try to upload that apk to play store.
Adding
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
in the build.Gradle file under DefaultConfig. Note that push to play store 64-bit requirement is coming.
I tried this By Official Android Docs. Working Excellent.
In this Solution, I have Build Multi APKs You can see in Attachment...
Make Sure Your Compile Skd Version is 29 or Build Tools Version Is 29.0.3 Written Bellow:
Android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "com.myapp.sk"
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
splits {
density {
enable true
reset()
include "mdpi", "hdpi"
}
abi {
enable true
reset()
include "x86", "x86_64"
}
}
}
// Map for the version code that gives each ABI a value.
ext.abiCodes = ['armeabi-v7a':1, x86:2, x86_64:3]
// For per-density APKs, create a similar map like this:
// ext.densityCodes = ['mdpi': 1, 'hdpi': 2, 'xhdpi': 3]
import com.android.build.OutputFile
// For each APK output variant, override versionCode with a combination of
// ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode
// is equal to defaultConfig.versionCode. If you configure product flavors that
// define their own versionCode, variant.versionCode uses that value instead.
android.applicationVariants.all { variant ->
// Assigns a different version code for each output APK
// other than the universal APK.
variant.outputs.each { output ->
// Stores the value of ext.abiCodes that is associated with the ABI for this variant.
def baseAbiVersionCode =
// Determines the ABI for this variant and returns the mapped value.
project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
// Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes,
// the following code does not override the version code for universal APKs.
// However, because we want universal APKs to have the lowest version code,
// this outcome is desirable.
if (baseAbiVersionCode != null) {
// Assigns the new version code to versionCodeOverride, which changes the version code
// for only the output APK, not for the variant itself. Skipping this step simply
// causes Gradle to use the value of variant.versionCode for the APK.
output.versionCodeOverride =
baseAbiVersionCode * 1000 + variant.versionCode
}
}
}
Multi-Aks Attachment
Native code: refers to an executable program that was compiled directly to the CPU instructions of the computer it is running on.
Non-native code: refers to an executable program that was compiled to the CPU instructions of the original Tandem architecture of the late 1970s and 1980s. When such a program is run, it cannot execute directly on the CPU of the computer it is running on. The NonStop operating system includes an interpreter for that original Tandem architecture, which is used to run such non-native code.
If your app uses only code written in the Java programming language or Kotlin, including any libraries or SDKs, your app is already ready for 64-bit devices. If your app uses any native code, or you are unsure if it does, you will need to assess your app and take action.
Does your app use native code?
The first thing to do is to check to see if your app uses any native code. Your app makes use of native code if it:
uses any C/C++ (native) code in your app.
links with any third party native libraries.
is built by a third party app builder that uses native libraries.
For more, visit the docs.
Option 1 - remove lib from APK.
Step 1 - convert the APK to ZIP and find lib folder; if you have lib folder, see the library dependency.
Step 2 - remove dependency from build Gradle.
Option 2 - Download 64-bit and 32-bit JAR file and add in your lib folder in app and build.
first open build.gradle module app and add these lines in order to remove .so files and add 64 bit liobraries
removing all .so files present in libs of apk
android {
compileSdkVersion 29
defaultConfig {
-----
-----
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions{
packagingOptions {
exclude 'lib/armeabi-v7a/libvudroid.so'
exclude 'lib/x86/libvudroid.so'
exclude 'lib/arm64-v8a/libvudroid.so'
}
}`
In my case, I was using a library (ESRI ArcGIS for Android) that makes use of OpenGL C libraries. Instead of the ndk.abiFilters... string that seems to fix everyone else's issues, I had to use the following:
ndk { abiFilters "armeabi-v7a", "arm64-v8a" }
Add this in your build.gradle
ndk.abiFilters 'arm64-v8a','x86_64'
I was trying to submit an apk of mine to the play store instant app section when i get the error - Your Instant App APKs should contain at least one base APK.
Now, the app was compiled using phonegap and phonegap provides only one APK which I have submitted to the play store.
I have read several documentations and other similar Qs but I can't find a solution to this.
The APK i am trying to submit as an Instant App is well under the 4mb limit and is properly signed too.
Any help would be appreciated.
EDIT : Tried submitting a zip too, no success. Is there anything specific the apk should be called or is instantApp fine?
The upload for an instant app should be a "Bundle" which Android Studio will create for you, it isn't just a single APK.
If you are trying to create using phonegap, it might work if you create a Zip file which contains your APK (not just renaming your APK to a zip).
So upload "instant.zip" which contains your apk "instant.apk"
It is also looking for the APK who's gradle contains baseFeature true, that is the base APK. See the docs
As TWL said, you might not have declared your module as base module. Here is how my build.gradle for base module looks like.
apply plugin: 'com.android.feature'
android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools
defaultConfig {
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard-rules.pro', getDefaultProguardFile('proguard-android-optimize.txt')
}
}
baseFeature true
}
You have to do two things.
apply com.android.feature plugin
set baseFeature true inside android block