How to make Android App Bundle ( aab ) file from apk?

That would make sense. I tried all of the instructions in README.md. Started from scratch and essentially ran these:

git clone --recursive https://github.com/openfl/lime
haxelib dev lime lime
haxelib install format
lime rebuild windows

That built some ndll’s for Windows and Windows64 with no problem.

But lime rebuild android -64 doesn’t:

PS C:\HaxeToolkit\haxe\lib\lime\from-cmd> lime rebuild android -64
Compiling group: native-toolkit-openal
arm-linux-androideabi-g++ -Ilib/openal/Alc -Ilib/openal/build/ -Ilib/openal/common/ -Ilib/openal/include/ -Ilib/openal/OpenAL32/include/ -DAL_ALEXT_PROTOTYPES -D_LARGEFILE_SOURCE -D_LARGE_FILES -Ilib/sdl/include/ -Ilib/sdl/include/configs/default/ -DHAVE_SDL2 -fPIC -fvisibility=hidden -pthread --std=c99 -Wno-psabi -fsigned-char --sysroot=C:\Users\greed\AppData\Local\Android\ndk\android-ndk-r10e/platforms/android-16/arch-arm -IC:\Users\greed\AppData\Local\Android\ndk\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.8/include -IC:\Users\greed\AppData\Local\Android\ndk\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=0(haxe) -IC:/HaxeToolkit/haxe/lib/hxcpp/4,0,64/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow -D_LINUX_STDDEF_H  -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV5 -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=16 -Wa,--noexecstack -O2 -DNDEBUG -c ... tags=[haxe,static]
 - lib/openal/Alc/effects/compressor.c
 - lib/openal/Alc/ringbuffer.c
 - lib/openal/Alc/mastering.c
 - lib/openal/common/atomic.c
 - lib/openal/OpenAL32/alSource.c
 - lib/openal/common/alcomplex.c
 - lib/openal/OpenAL32/alBuffer.c
Error: In file included from lib/openal/OpenAL32/include/alMain.h:28:0,
                 from ./lib/openal/OpenAL32/alBuffer.c:31:
lib/openal/common/atomic.h:27:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
Error: In file included from ./lib/openal/Alc/ringbuffer.c:29:0:
lib/openal/common/atomic.h:27:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
Error: In file included from lib/openal/OpenAL32/include/alMain.h:28:0,
                 from lib/openal/OpenAL32/include/alError.h:4,
                 from ./lib/openal/Alc/effects/compressor.c:24:
lib/openal/common/atomic.h:27:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.

Any good way to see where stdatomic is or if it’s there?

Run lime rebuild android with the Android r15c NDK to rebuild Lime

Using r15c fixed everything. (I was on r10-something.) Thanks for the support!

1 Like

Hi, was anyone recently able to upload two different APKS for ARMV7, ARM64 using the hint “same version number and different version code”. I tried everything I can imagine but Google Console refuses to accept my APKs.

Any other news here? Maybe that App Bundle is in its way?

You can now create Android App Bundle by using the latest version of Lime/HXCPP
<setenv name="ANDROID_GRADLE_TASK" value=":app:bundleRelease" />

I still did not know what happened at your side but I was able to upload different apk files on Google Play Console

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.yourapp" android:versionCode="4602" android:versionName="1.0.0" android:installLocation="auto">
	
	<!--<uses-feature android:glEsVersion="0x00020000" android:required="true" />-->
	
	<!--<uses-permission android:name="android.permission.WAKE_LOCK" />-->
	<uses-permission android:name="android.permission.INTERNET" />
	<!--<uses-permission android:name="android.permission.VIBRATE" />-->
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
	<!--<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29"/>-->
	
	<application android:label="Name of your app">	
		<meta-data android:name="android.max_aspect" android:value="2.5" />
	</application>

          <!--uncomment if using admob ex-->
	<!--<uses-library android:name="org.apache.http.legacy" android:required="false"/>-->
	<supports-screens 
		android:resizeable="true"
		android:smallScreens="true"
		android:normalScreens="true"
		android:largeScreens="true"
		android:xlargeScreens="true"
		android:anyDensity="true"/>	
</manifest>

Using android:versionCode=“4602” for 32bit app (armv7) and android:versionCode=“4603” for 64bit app(arm64). The versioncode of 32bit app is always lower than 64bit app and upload app that supports armv7 chipset first!

project.xml (in short)

   >  <meta title="Name of your app" package="com.yourcompany.yourapp" version="1.0.0" company="Your Company" />
>     	
>     	<!-- output -->
>     	<app main="Main" file="yourapp" path="bin" />
> <!--<setenv name="ANDROID_GRADLE_TASK" value=":app:bundleRelease" />-->
>     <!--<architecture name="arm64" if="android"/>-->
> 	<!--<architecture exclude="armv7" if="android"/>-->
> 	
> 	<architecture name="armv7" if="android"/>
> 	<architecture exclude="arm64" if="android"/>
> <config:android minimum-sdk-version="19" target-sdk-version="29" />
> <template path="templates/AndroidManifest.xml" rename="AndroidManifest.xml" if ="android" />
<window hardware="true" allow-high-dpi="true" width="0" height="0" orientation="portrait" fps="60" resizable="true" vsync="false" fullscreen="true" antialiasing="0" if="cpp"/>
5 Likes

Man I can build a app bundle now. Thank you very much. <3 <3 <3

Works here too. Thanks!

Great, it works here as well

No more 2 apks, bundle is mandatory now:

Starting August 2021, new apps will be required to target API level 30 (Android 11) and use the Android App Bundle publishing format. Starting November 2021, all app updates will be required to target API level 30 (Android 11).

How to Convert website into ABB?

Could you please help me Im a bit thick what am I doing wrong thank you for the script

<?xml version="1.0" encoding="utf-8"?>
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="tailbert11">
    <meta-data android:name="android.max_aspect" android:value="2.5" />
</application>

<uncomment if using admob ex>
<uses-library android:name="tailbert"/> 
<supports-screens
    android:resizeable="true"
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"
    android:anyDensity="true"/>
Using android:versionCode=“4602” for 64bit app (armv8) and android:versionCode=“4603” for 8

If you want to upload your file to the Play Store, let’s use aab format

setenv name=“ANDROID_GRADLE_TASK” value=":app:bundleRelease"

Please keep in mind, delete all you xml tags that related to “armv7, arm64”.

For your Android Manifest file you should delete the “uncomment if using admob” line. :+1::grin:

2 Likes

Thank you so much :grinning: Ok fixed that up having problems with the Gradle

Where do I put the setenv name=“ANDROID_GRADLE_TASK” value=":app:bundleRelease" please and thank you :grinning:

sorry to be annoying I did say I was a bit thick :sweat_smile: what do I put in here
defaultConfig {
applicationId “tailbert1.yes”
minSdkVersion 14
targetSdkVersion 30
versionCode “01”
versionName “11”

Add this line to your project.xml (not android manifest file). For more info you should dig in the Lime /OpenFL documentation or take a look on my comment above. Ah, let’s use command line for creating apk/aab files faster and much easier.

1 Like

It seems you was using the VS Code Extension, right?. I’m not familiar to it, i’m working with Haxe Develop. Let’s ask someone else :smiley::grin: or post a new question.

1 Like

Hi again can you please show me step by step how to package a apk to an aab I have installed lime on my android studio downloaded the sdks could you please tell me what I have to do now I have my apk that was created in animate :smiley:

To create aab from apk follow steps
1.Decompile apk with apktool
2.copy res and Androidmanifest into folder
3.compile all resources into .flat files with aapt2 compile command
4.use aapt2 link command to pack resources of apk into protobuf format
5.Make base.zip and use build bundle command to create apk

or simply use apktoaabconverter.com but its paid

1 Like

I have a problem.
I can create apk file with Android Studio but if I select Android App Bundle option, it will delete everything in Release folder and gives the error that jls file is mot found.