Search Unity

Build and Run fails: BundleConfig.pb missing.

Discussion in 'Android' started by username132323232, May 30, 2019.

  1. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Trying to build app bundle with ARMv7 and ARM64 target architectures. The .aab file gets created, but the app fails to install on the attached smartphone. Any suggestions?

    Error:
    Installation failed with the following output:
    [BT:0.6.0] Error: The archive doesn't seem to be an App Bundle, it is missing required file 'BundleConfig.pb'.
    com.android.tools.build.bundletool.exceptions.BundleFileTypesException$MandatoryBundleFileMissingException: The archive doesn't seem to be an App Bundle, it is missing required file 'BundleConfig.pb'.

     
  2. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    anyone having the same problem?
     
  3. weiping-toh

    weiping-toh

    Joined:
    Sep 8, 2015
    Posts:
    192
    Have you tried exporting out into the Android Studio project to see if it exports correctly? My project also builds out the app bundle version and it is working fine. It might be some misconfiguration of the gradle script or errors during the gradle build. Try exporting to the Android studio project and gradle build from there to see if it is a Unity issue or project misconfiguration.
     
  4. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Thank you for your suggestion. I have never exported to Android Studio, but I'm willing to try. The question is that suppose it builds in Android Studio. That would mean that the problem is on Unity side. How would I proceed fixing it?
     
  5. weiping-toh

    weiping-toh

    Joined:
    Sep 8, 2015
    Posts:
    192
    If the problem is on Unity side, there is nothing else you can do about it except for changing your build workflow to build via Android Studio.
     
    username132323232 likes this.
  6. weiping-toh

    weiping-toh

    Joined:
    Sep 8, 2015
    Posts:
    192
    You might want to test the output bundle using bundletool. https://developer.android.com/studio/command-line/bundletool

    Android bundle is a relatively new feature even for play store itself. So I would expect bugs from Unity misconfiguring the gradle build step to generate the bundle.

    As of now, the other issue I am currently facing with the gradle build is with the gradle build cache not being cleaned. I understand that having the cache speeds up process by skipping out on certain binaries but can Unity at the very least provide a "clean before build" option when running gradle build as gradle has the tendency to misjudge deltas of compiled binaries.
     
    username132323232 likes this.
  7. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    That's a great idea. Thanks again. I really appreciate your help with this tricky problem!
     
  8. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    How are you guys getting along with these bundles, any success with generating a valid .aab?
     
  9. weiping-toh

    weiping-toh

    Joined:
    Sep 8, 2015
    Posts:
    192
    I am currently using the export project option to interject with a gradle clean before bundling to clear away the cache and include in a --no-build-cache option via the cli mode. Unity build settings should include a simple toggle for this particular flag during build....
     
    username132323232 likes this.
  10. dm_bond

    dm_bond

    Joined:
    Sep 19, 2011
    Posts:
    62
    AAB looks correct and contains BundleConfig.pb. If replace bundletool-all-0.6.0.jar with fresh bundletool-all-0.10.0.jar also no install but no errors in Editor.log. AAB install successfully from command line with fresh bundletool (build-apks, install-apks).
     

    Attached Files:

  11. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Hi, did anyone get to the bottom of this? I'm trying to make a new update for my app that's made in Unity 2018.4.31 but i'm getting this error when trying to upload to google play. Unity completes the build without errors.
     
  12. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I figured it out. My build script was building a bundle but it wasn't setting

    Code (CSharp):
    1. EditorUserBuildSettings.buildAppBundle = true;
    and that box wasn't checked manually in Build Settings.
     
  13. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    76
    So I finally figured out what caused this for me. I had pre-selected to replace the old filename.apk, BUT then I checked the "Build App Bundle" checkbox. So it seemed Unity was trying to save an app bundle with the .apk format and threw the error.
     
    hahahpizza, RSH1 and rbitard like this.
  14. ABerlemont

    ABerlemont

    Joined:
    Sep 27, 2012
    Posts:
    67
    Thanks. You saved my afternoon.
     
    zackblack likes this.
  15. gug_e

    gug_e

    Joined:
    Apr 13, 2019
    Posts:
    1
    Thank you. You saved my life.