How to create geckoview FAT AAR?

How to create FAT AAR with multiple architectures?
AAR and POM files are included (released build). Firefox 131 source.

root@9e6bfae6b70f:/firefox/mozilla-unified# ./mach configure --disable-compile-environment --enable-application=mobile/android
root@9e6bfae6b70f:/firefox/mozilla-unified# ./mach build android-fat-aar-artifact -v
os.nice(19)
0:00.45 W Clobber not needed.
Parallelism determined by memory: using 15 jobs for 16 cores based on 15.0 GiB RAM and estimated job size of 1.0 GiB
0:00.51 /usr/bin/gmake -j15 android-fat-aar-artifact
0:00.52 /usr/bin/gmake recurse_android-fat-aar-artifact
0:00.53 gmake[1]: Entering directory ‘/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu’
0:00.54 /root/.mozbuild/srcdirs/mozilla-unified-6cd42f69fc1c/_virtualenvs/build/bin/python -m mozbuild.action.fat_aar --armeabi-v7a /firefox/libtarget/armeabi.aar --arm64-v8a /firefox/libtarget/arm64-v8a.aar --distdir /firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/fat-aar
0:02.86 Allowed: Path “chrome/toolkit/content/global/buildconfig.html” has architecture-specific versions:
0:02.86 arm64-v8a -> 1e389d539f32975d95a0c446c805a6297bfc5a4f
0:02.86 armeabi-v7a -> d698760ad2c4c1f3ed8c3fbfb00dffdba4038607
0:02.86 Allowed: Path “classes.jar!/org/mozilla/geckoview/BuildConfig.class” has architecture-specific versions:
0:02.86 arm64-v8a -> 1b5708390d8ebbbc6ed1941f58a43addcc67d5f8
0:02.86 armeabi-v7a -> 1414edc9b46869fe73ebf4607ea9c25fc0f06ce2
0:02.86 Disallowed: Path “classes.jar!/org/mozilla/geckoview/CrashHandler$1.class” has architecture-specific versions:
0:02.86 arm64-v8a -> ca1989bb7ec70146267ee221294c3711b43b88a8
0:02.86 armeabi-v7a -> aaa115ed98601b61531b8b4c200a3283345d2fce
0:02.86 Disallowed: Path “modules/AppConstants.sys.mjs” has architecture-specific versions:
0:02.86 arm64-v8a -> 7799bc26fa4723e8ec733eeda2486f9f1483f480
0:02.87 armeabi-v7a -> fde8573a104189c8d39cf189a4460488361e7906
0:02.92 gmake[1]: *** [Makefile:139: recurse_android-fat-aar-artifact] Error 1
0:02.92 gmake[1]: Leaving directory ‘/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu’
0:02.92 gmake: *** [/firefox/mozilla-unified/config/recurse.mk:34: android-fat-aar-artifact] Error 2
0:03.12 W 0 compiler warnings present.
Hey! Builds initiated with mach build $A_SPECIFIC_TARGET may not always work, even if the code being built is correct. Consider doing a bare mach build instead.
root@9e6bfae6b70f:/firefox/mozilla-unified#

I’m having exactly the same output. Were you able to get it running? @devel2ew

Edit: Found the solution! 1759727 - Add documentation for how to produce Android GeckoView universal (fat) AAR s locally

Previously, the aar files for 64-bit and v7a have been generated and copied to /firefoxnew/libs.

mozconfig

export MOZILLA_OFFICIAL=1
mk_add_options AUTOCLOBBER=1
ac_add_options --disable-compile-environment
ac_add_options --enable-project=mobile/android
ac_add_options --enable-official-branding
ac_add_options --with-branding=browser/branding/official
ac_add_options --with-branding=mobile/android/branding/official
ac_add_options --enable-release
mk_add_options AUTOCLOBBER=1
ac_add_options --disable-tests
ac_add_options --disable-debug
mk_add_options MOZ_FETCHES_DIR=/firefox/mozilla-unified/
mk_add_options MOZ_ANDROID_FAT_AAR_ARCHITECTURES=armeabi-v7a,arm64-v8a
mk_add_options MOZ_ANDROID_FAT_AAR_ARM64_V8A=/firefoxnew/libs/geckoview-arm64.aar
mk_add_options MOZ_ANDROID_FAT_AAR_ARMEABI_V7A=/firefoxnew/libs/geckoview-v7a.aar
./mach build
ValueError: Maven zip "/firefoxnew/libs/geckoview-arm64.aar" with more than one candidate AAR found: []

It worked for me up to version 142, but after version 143 it started to fail, always with that error.

SOLVED
Instead of specifying the .AAR file, compress the files into ZIP format. “zip file.zip file.arr” and specify the ZIP files instead of the AAR files in the environment variables.