Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android App Bundle support #610

Closed
shanlin2dltk opened this issue Jan 2, 2019 · 39 comments

Comments

@shanlin2dltk
Copy link

commented Jan 2, 2019

What is the plan to support Android App Bundle .aab in a cordova build?

@shanlin2dltk

This comment has been minimized.

Copy link
Author

commented Jan 2, 2019

added one reference article to show android is moving to this direction:
https://medium.com/googleplaydev/what-a-new-publishing-format-means-for-the-future-of-android-2e34981793a

@dpogue

This comment has been minimized.

Copy link
Member

commented Jan 2, 2019

I've been investigating this (along with some other gradle updates for stuff like Kotlin and Google Services). It's clear that we should support this going forward, but I don't think it will actually provide any benefits to Cordova apps in terms of APK size.

Unfortunately, it doesn't look like I'm going to have any time to work on Cordova stuff for the next month or two, so unless someone else picks it up it won't be until sometime later in the year.

@shanlin2dltk

This comment has been minimized.

Copy link
Author

commented Jan 2, 2019

Thanks @dpogue for giving a timeline.

@mesqueeb

This comment has been minimized.

Copy link

commented Jan 5, 2019

So Cordova currently only supports APK right?

@dpogue

This comment has been minimized.

Copy link
Member

commented Jan 5, 2019

So Cordova currently only supports APK right?

At this time, that is correct.

@fortunella

This comment has been minimized.

Copy link

commented May 8, 2019

Any updates on this?
Currently, the Google Play Console shows a warning each time you upload an APK.

@janpio

This comment has been minimized.

Copy link
Member

commented May 8, 2019

(A good solution would probably be to open a Feature Request issue, so this can be tracked and doesn't get lost in a closed issue @fortunella)

@pabloleone

This comment has been minimized.

Copy link

commented Jun 4, 2019

Google is not allowing me to roll-out an APK and it's suggesting me to use the Bundle build, but as far as I understand we can't use that build format yet which makes impossible to publish new apps using cordova-android if I'm right.

I think this should be a top-urgent feature to cover to keep using cordova.

Screenshot 2019-06-04 at 17 42 20

@janpio

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

You better create a new issue for this, so it doesn't get buried here.

Please also include specific information about your app, like the APK size etc.

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

@pabloleone You should be still able to publish apps that contains warnings. In my experience, Google only ever prevents publishing if the contains "errors". But I do agree, this is an important enhancement and something I can definitely can foresee Google enforcing in the future.

@malvarez-troop

This comment has been minimized.

Copy link

commented Jun 5, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

@zarabz

This comment has been minimized.

Copy link

commented Jun 5, 2019

Worked for me! thank you so much
In case anyone else have problems with updating their Android Studio and Gradle versions, remove minSdkVersion from config.xml and add these to your manifest (your version may vary)
android{
...
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
}
}

@theunreal

This comment has been minimized.

Copy link

commented Jun 9, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

Android studio is not asking you to upgrade the gradle plugin version every time you build the app?

@etcho

This comment has been minimized.

Copy link

commented Jun 9, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.

The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

My project don't have an Android plataform folder, only browser. And when I try to import it, Android Studio says that my project contains non-ASCII characters... Don't know what to do.

@malvarez-troop

This comment has been minimized.

Copy link

commented Jun 9, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.
The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

Android studio is not asking you to upgrade the gradle plugin version every time you build the app?

I did not have the problem. But a developer in my company has to update Gradle. Tomorrow I'm going to ask her about that

@malvarez-troop

This comment has been minimized.

Copy link

commented Jun 9, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.
The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

My project don't have an Android plataform folder, only browser. And when I try to import it, Android Studio says that my project contains non-ASCII characters... Don't know what to do.

You have to add android platform first to build a Android project

@xale76

This comment has been minimized.

Copy link

commented Jun 15, 2019

Hello I don't understand. What's step 3? where I can find /platforms/android? I build with PhoneGap and I don't have this folder. Please help me

@Lukaskaras

This comment has been minimized.

Copy link

commented Jun 15, 2019

Hi, @pabloleone
We have generated the bundle with Android Studio.
The steps are:

  1. Launch Android Studio
  2. Go To Import Project (Eclipse ADT, Gradle, etc).
  3. Select Android platform directory in your project (/platforms/android).
  4. Wait for finish the Sync
  5. Go to Build > Generate Sign Bundle
  6. Complete sign data
  7. Upload de .aab file generated (in path /platforms/android/outputs/

Note: if you have problems with minSDK version, fix this and make a resync

Android studio is not asking you to upgrade the gradle plugin version every time you build the app?

I have exactly this problem. Can't get past it. Was changing the Android Gradle Plugin version manually through File -> Project Structure, but didn't help. Anybody knows how to solve it?

@xale76

This comment has been minimized.

Copy link

commented Jun 15, 2019

facing the same issue, I build my app by phonegap, even there nobody gives solutions. since 1st August, google will no longer accept Apk, I'm scared! any solution for phonegap??

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

facing the same issue, I build my app by phonegap, even there nobody gives solutions. since 1st August, google will no longer accept Apk, I'm scared! any solution for phonegap??

I could not find anything that said Google won't be accepting APKs after August 1st. Are you sure you're not confusing that with the incoming 64-bit enforcement?

@xale76

This comment has been minimized.

Copy link

commented Jun 15, 2019

maybe anyway how to enforce to 64bit with Phonegap?

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

maybe anyway how to enforce to 64bit with Phonegap?

Not sure... It's important to note that you only need to provide 64bit APK if you use native libraries with your application. Cordova does not use native libraries in any of its plugins that Cordova manages. If you do use a plugin that includes a native library, cordova already supports building multiple APKs by 32/64bit variant which satisfies Google's 64bit enforcement. But whether you need to use that build method is entirely dependent on your app.

@janpio

This comment has been minimized.

Copy link
Member

commented Jun 15, 2019

@xale76 You should ask the Phonegap people, not Apache Cordova. And even if you want to ask this here, do so in a new issues instead of asking off topic question in an issue about Android App Bundle support.

@xale76

This comment has been minimized.

Copy link

commented Jun 15, 2019

@breautek so I don't understand why Google warnes me: I only build PG with standard Cordova plugins or NPM. please how can I check if I need to take any action or noT? Is there any tool I can use?

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

@breautek so I don't understand why Google warnes me: I only build PG with standard Cordova plugins or NPM. please how can I check if I need to take any action or noT? Is there any tool I can use?

Regarding App Bundles, google is warning everyone who is still publishing the old way. They are just recommending developers to make the switch. At the time of writing, they have announced no plans forcing people to use app bundles.

@goynov

This comment has been minimized.

Copy link

commented Jun 21, 2019

Once you've opened, synced and built using the Android Studio (3.2+), you can use this command line from the ./platforms/android/ directory:
./gradlew app:bundleRelease

@jfoclpf

This comment has been minimized.

Copy link

commented Jun 23, 2019

@malvarez-troop
Is there any way to do the same with the command line adb ?

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

@malvarez-troop
Is there any way to do the same with the command line adb ?

I don't believe so. adb is for communicating with your android device. You can't deploy .aab files to your android device directly. They meant exclusively for deploying your app to the Google Play store. As @goynov said, you can use ./platforms/android/gradlew app:bundleRelease from within ./platforms/android/ directory, run `./gradlew app:bundleRelease to generate the aab bundle for now.

@jfoclpf

This comment has been minimized.

Copy link

commented Jun 23, 2019

I found it! Here on Google they have instructions on how to build the bundle file with the command line.

you can use ./platforms/android/gradlew app:bundleRelease to generate the aab bundle for now.

Thanks a lot @BBosman

@jfoclpf

This comment has been minimized.

Copy link

commented Jun 23, 2019

@BBosman apologies but I'm not that versed in gradle but what shall I put in app? The project id? CordovaLib?

@goynov

This comment has been minimized.

Copy link

commented Jun 24, 2019

You should run ./gradlew app:bundleRelease from this directory: ./platforms/android/

./platforms/android/gradlew app:bundleRelease will not do the job.

And it will work only when you upgrade Android Studio to 3.2+ and then open your project using the studio, sync it, resolve possible issues and then build.

@jfoclpf

This comment has been minimized.

Copy link

commented Jun 24, 2019

@goynov thanks for the tip, I will try it. But according to google instructions

The easiest way to build an app bundle is by using Android Studio. However, if you need to build an app bundle from the command line, you can do so by using either Gradle or bundletool, as described in the sections below.

It gives some how the impression that we can avoid Android Studio. But maybe it's like you say, we use the command line but we need to have Android Studio installed and synced. They talk about bundletool and AAPT2 but I had not the time to read all of that documentation thoroughly.

@hugoblanc

This comment has been minimized.

Copy link

commented Jul 4, 2019

Google is not allowing me to roll-out an APK and it's suggesting me to use the Bundle build, but as far as I understand we can't use that build format yet which makes impossible to publish new apps using cordova-android if I'm right.

I think this should be a top-urgent feature to cover to keep using cordova.

Screenshot 2019-06-04 at 17 42 20

In my case I thought I was not able to publish because of this, but in fact, that was due to others play store sections which was not completly filled

@ewwwgiddings

This comment has been minimized.

Copy link

commented Jul 7, 2019

If anyone experiences errors with leftShift() not found as I did. See this SO post:
https://stackoverflow.com/questions/55793095/could-not-find-method-leftshift-for-arguments-after-updating-studio-3-4

@martinjuhasz

This comment has been minimized.

Copy link

commented Jul 23, 2019

Google is not allowing me to roll-out an APK and it's suggesting me to use the Bundle build, but as far as I understand we can't use that build format yet which makes impossible to publish new apps using cordova-android if I'm right.
I think this should be a top-urgent feature to cover to keep using cordova.
Screenshot 2019-06-04 at 17 42 20

In my case I thought I was not able to publish because of this, but in fact, that was due to others play store sections which was not completly filled

This is a very valid response. i also thought i cannot publish (for internal testing) because of this warning (button was greyed out) but it was in fact because of the not fulfilled informations for a new app.

Make sure all checkmarks on the left navigation panels are green, then this should not be an issue for releasing

@patrickbussmann

This comment has been minimized.

Copy link

commented Jul 31, 2019

I'm having the same issue and I fixed it via this command.

cd platforms/android && ./gradlew bundle

Found it here: #729 (comment)

But when cordova-android will fix it? 🥳

@breautek

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2019

But when cordova-android will fix it? 🥳

Most likely in cordova-android version 9. You can keep track of the PR progress at #764.

@pookdeveloper

This comment has been minimized.

Copy link

commented Aug 7, 2019

IMPORTANT resolve the grey check points to publish and ignore the alert

@tomriddle1234

This comment was marked as off-topic.

Copy link

commented Aug 11, 2019

this is not alert or warning anymore, but an error. there's no solution yet, although above method could generate aab file, but it doesn't contain 64bit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.