Problem creating .aab archive for Android TV

Hello,

I have an error message when I add in the app descriptor Android TV :

<android>
  <manifestAdditions> 
    <![CDATA[ 
      <manifest> 
        <uses-permission android:name="android.permission.PERMISSION_NAME" />
      </manifest>
    ]]> 
  </manifestAdditions>
  <supportsAndroidTV>true</supportsAndroidTV>
  <banner>/assets/mybanner.png</banner>
</android>
Bundle tool failed:[BT:0.10.3] Error: Multiple entries with same key: res/drawable/banner.png=ModuleZipEntry{getZipEntry=res/drawable/banner.png, getZipFile=java.util.zip.ZipFile@b7f23d9, getPathNamesToSkip=0, shouldCompress=true} and res/drawable/banner.png=ModuleZipEntry{getZipEntry=res/drawable/banner.png, getZipFile=java.util.zip.ZipFile@b7f23d9, getPathNamesToSkip=0, shouldCompress=true}
java.lang.IllegalArgumentException: Multiple entries with same key: res/drawable/banner.png=ModuleZipEntry{getZipEntry=res/drawable/banner.png, getZipFile=java.util.zip.ZipFile@b7f23d9, getPathNamesToSkip=0, shouldCompress=true} and res/drawable/banner.png=ModuleZipEntry{getZipEntry=res/drawable/banner.png, getZipFile=java.util.zip.ZipFile@b7f23d9, getPathNamesToSkip=0, shouldCompress=true}
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:190)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:109)
at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:95)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:373)
at com.android.tools.build.bundletool.model.$AutoValue_BundleModule$Builder.build($AutoValue_BundleModule.java:267)
at com.android.tools.build.bundletool.validation.BundleModulesValidator.toBundleModule(BundleModulesValidator.java:103)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Collections$2.tryAdvance(Unknown Source)
at java.util.Collections$2.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.android.tools.build.bundletool.validation.BundleModulesValidator.validate(BundleModulesValidator.java:82)
at com.android.tools.build.bundletool.commands.BuildBundleCommand.execute(BuildBundleCommand.java:208)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:70)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)

step to reproduce on Windows :
adt -package -target aab <signing options> output.aab <app descriptor and files>

Thanks

see Announcement: If you ask for help about code

I assume you’re using AIR SDK 33 but again I don’t know

the AAB packaging is experimental and does not work in many case, especially when you use ANE

the current solution is to publish 2x APK, one in 32-bit and one in 64-bit
following the Android docs Multiple APK support

see previous discussions

And again I would advise to do an automated build so all those little details are done for you
eg, spend few days to setup/script/tune an automated build

once you have automated stuff like unpack APK, pack APK, change version number, etc.
it is very easy to publish in ARM 32-bit, x86 32-bit, ARM 64-bit x86 64-bit with 4 different series of version numbers, doing that by hand is error prone and nuts imho

I know that, but it’s more simple to publish only one file, using apk it’s necessary to create four apks (ARMv7, ARM64, x86, x64) for one release, and I have warning in Google Play Developer Console (not a problem for now).
Please add a comment here, so Harman knows about the bugs and fix it.

Quick comment on the AAB thing: there are definite issues with this, and we’re trying to see whether it is going to be possible to do this at all… the AAB format includes one resource bundle and when we have ANEs, we may need to have multiple ones of these. We know we could make it work if we were to enforce certain rules on ANE vendors but these would mean they would have to rework all their existing ANEs which is a non-starter. So we are looking into alternative solutions, but for now I’m afraid the best bet is still to use multiple APKs…

thanks

Thanks for your answer, but i don’t use ANE in this project, I just added the support of Android TV and I have a duplicate resource banner.png (the home screens app launcher banner of TV devices).

ahem @pol2095 it is all good and well to answer back “thanks for the answer”
but you’re not listening what ppl say: everyone is telling you to build APK
and you won’t because “it’s not simple”

I would say it is not that hard either, learn to do automated builds and build APK
or wait an unknown amount of time for maybe one day AAB to be available

your choice

I publish multiple APKs since a long time, I report the problem.