Build a Bundle App for Google play 64bits and 32 bits - android

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.

Related

How to convert multiple apk files into a unified bundle

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.

Can I Upload 3 APKs At Once to Play Store?

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.

Android adapt realm to 64 bit

I am migrating one application to 64 bit to make an update in Google Play store but, after follow android developers instructions, Google play console keeps saying I have to adapt to 64 bit.
Inside Analyze APK I have the following:
I have also included in my gradle file the following:
myApplication {
minSdkVersion 21
applicationId 'com.app.myApplication'
targetSdkVersion 28
versionCode 150
versionName '2.8.0'
signingConfig signingConfigs.myApplication
manifestPlaceholders = [ROTATION_PREF: "unspecified"]
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
What I am missing?
Thank you,
All problem was with realm version.
The one that I had was to old to adapt to 64-bit environment.
Once's I changed the version for a newer one, x86_64 library appeared.

Impossible to create APK with 64 bits lib under Android Studio

I need to update an existing app on the Play Store. For this reason, since August, Google has requested to provide 64-bit versions as well.
I have included the instructions provided in the build.gradle app as follows:
compileSdkVersion 28
defaultConfig {
applicationId "com..."
minSdkVersion 24
targetSdkVersion 28
versionCode 10
versionName "1.5"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'arm64-v8a','x86_64','armeabi-v7a','x86'
}
}
and:
splits {
abi {
enable true
reset()
include 'arm64-v8a','x86_64','armeabi-v7a','x86'
universalApk true
}
}
I am able to generate the APK as expected, but unfortunately both arm64-v8a and x86_64 versions do not contain any 64-bit code.
There is no lib directory when analyzing the APK in Android Studio while the APK armeabi-v7a includes lib / libarm_arch.so.
Note no error message is shown by the compilation process.
Can a dependency cause this problem and why can't Android Studio show an error message?
How can I identify why the 64-bit version is not generated?
I'm using Android Studio for 3.5.
After searching about the libarm_arch.so library, I have found that it's linked to FFMPEG. But FFMPEG is not referenced in my Gradle dependencies and I have not still found how to tell to Android Studio to embed the arm68-v8a version of the library as well.
Thanks for your help.
I had the same problem, I've converted a project of 2 years ago to latest Android Studio, now I need to generate the 64bit, but APK built and Bundle do not generate 64 bit output.
I found out I had a directory which was causing this incompatibility:
app/src/main/jniLibs (this one had /armeabi /armeabi-v7a /x86 subdirs in it)
I fixed it by deleting the directory jniLibs.
How can I identify why the 64-bit version is not generated?
from https://developer.android.com/distribute/best-practices/develop/64-bit#64-bit-libraries
In a typical case, an APK or bundle that's built for both 32-bit and 64-bit architectures will have folders for both ABIs, each with a corresponding set of native libraries. If there's no support for 64-bit, you'll likely see a 32-bit ABI folder but *not a 64-bit folder*.
Edit:
if your read just one the same link
https://developer.android.com/distribute/best-practices/develop/64-bit#port-32-to-64
you will confirm if you are really making any change on your code to be able to port 32 to 64
you could be doing the right step on the gradle , but not in the code.
i can't say anything more if you don't provide a sample
Android Studio don't have anything to complains if you keep your code on 32 and try to build to 64, it just keep your 64 folder build result empty as a point on my first response
I hope that helps :)

Android APK failed to upload to play store Strange issue

I am having this issue for two years. I can't be able to upload android APK to play store. The app is written in phonegape and I compile the Signed APK from android studio.
What I am having error is:
Your APK's version code needs to be higher than 100008.
Facts:
There are nothing like 100008 word or number in whole project.
I changed All version codes to 100009, still same error
Android Studio uses Gradle to build your projects.
To increment the android version code using Gradle add the following to build.gradle in your app module:
defaultConfig {
minSdkVersion XX
targetSdkVersion YY
versionCode 100009
versionName "Your Version Name"
}
Replacing where necessary. The key part is the versionCode must be higher than what is already on the store.
I suggest you to decompile your apk and check a version in the result manifest file.
You may use this tool http://ibotpeaches.github.io/Apktool/
Hope it helps!
I guess you have read this already: https://developer.android.com/studio/publish/versioning.html

Categories

Resources