Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Creating Android App Bundles (aab) with Unity Cloud Builds

Discussion in 'Unity Cloud Build' started by Nieles_GH, Dec 19, 2018.

  1. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    116
    It only works half way - the aab is indeed created, but no matter what I do it only contains one architecture. I've tried setting all 3 architectures in the build settings, and also try to force set them through a pre-export step in CB.

    We are currently shut out from updating our live game until this is fixed.
     
  2. jason-vreps

    jason-vreps

    Joined:
    Sep 22, 2017
    Posts:
    9
    First off, I'd like to commend the Cloud build team for so many swift improvements in this realm. As Google's mandated 64-bit deadline approaches, seeing these quick reactions are very important and appreciated.

    At this point, I've been successfully building .AABs through Cloud Build and been uploading them to the Play store. However, I now find myself in the same position as @HaakonL. After the AAB is unpacked by the play store, it only recognizes 2 APKs. In my situation, it was able to find the x86 and armeabi-v7a (ARMv7) versions, but not the ARM64 version.

    From the Google Play Console, I navigated to "Release Management > Artifact Library" and under "Active Artifacts", I found my recently released version code. Then I pressed the "EXPLORE" link on the right side, and was presented with this screen:



    Indicating that only 2 APKs were found.

    Edit: SOLVED
    I went back into my player settings for Android and noticed that ARM64 was not selected. The option was greyed out, so to get it to enable, I switched Scripting Backend from Mono to IL2CPP, enabling the ARM64 option. Once this was selected, and the changes were pushed to our repo, the next AAB build included 3 native builds, and the Artifact Library confirmed that the included builds are arm64-v8a, armeabi-v7a, and x86.

    My mistake! I had thought that an AAB would package all 3 builds automatically. Sorry for any alarm!
     
    Last edited: Jul 3, 2019
  3. Eric-Farraro

    Eric-Farraro

    Joined:
    Apr 23, 2013
    Posts:
    27
    Perhaps I misunderstood @victorw , but I didn't see the option to build .aab in Unity Cloud build. This is what I see in Advanced Options - should I be looking somewhere else?


    upload_2019-8-6_11-4-27.png
     
  4. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    318
    @Eric-Farraro the build target needs to be configured to build against Android with a version of Unity which supports Android App Bundle builds (2018.3+ or 2017 LTS versions greater than .4.17)
     
  5. Eric-Farraro

    Eric-Farraro

    Joined:
    Apr 23, 2013
    Posts:
    27
    @victorw Can confirm - I was running 2018.1 and updating to 2018.3 resolved my issue. Thanks for the quick response, you're a lifesaver!

    Shoutout to @jason-vreps as well - thanks for taking the time to update your post to include your solution on Google rejected the .aab due to lack of 64-bit support. I later ran into the same issue and your response was critical to helping me solve it.
     
    Last edited: Aug 7, 2019
    jason-vreps likes this.
  6. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    318
    FYI I'm going to revert the workaround that was required to support the old method of generating AABs soon, if you are still using that method (pre-export build scripts) then you will need to switch your build targets over to having their APK/AAB settings configured by UCB.

    I mean technically you can use both but UCB is going to override whatever you set. Also we do have plans to resolve all of these weird order of operation issues in the not-too-distant future but for I'll have to override whatever buildAppBundle settings you set in the pre-build script.

    (If you don't understand what I'm saying here then there it probably does not apply to you and there is no need to panic)

    EDIT: Workaround has been reverted! If your project is suddenly not building AABs anymore then please ensure that your build target is configured correctly.
     
    Last edited: Sep 18, 2019
    matiasticbits likes this.
  7. fishbai

    fishbai

    Joined:
    May 15, 2018
    Posts:
    2
    Just an FYI. I had my Unity version set to "Always use latest 2017.4.x" and I was NOT seeing the option @victorw mentioned for building Android App Bundles. After setting the version to one explicitly higher than 2017.4.17 I can now see the option.
     
  8. firegate666

    firegate666

    Joined:
    Nov 20, 2015
    Posts:
    16
    Hey guys. Just started with aab building from cloud and management to get it running by setting aab in the advanced settings. When trying to upload, it complained that this was a debug build. I changed the Debug Keystore to my general keystore and rebuilt. Then it complained that my key is too weak.

    But anyways: I don't want to select I keystore, I want to select my deployment certificate that I downloaded from the Google Play Store because aab doesn't use keystored. Where can I define that the cloud build uses my "deployment_cert.der"?

    EDIT: I figured out what I did wrong here.... new applications need more secure keystores but old applications still can use the old keystore and then you can upload everything using app bundles.
     
    Last edited: Oct 16, 2019
  9. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    318
    Thanks for letting me know about this, I've added a ticket for taking another look at the version resolution code.
     
  10. jbassking

    jbassking

    Joined:
    Feb 27, 2014
    Posts:
    59
    I don't see the setting in the Advanced settings in the cloud build. Could it be because I'm on 2017.4x? If it's not available for this version, is there a workaround? I'm trying to get the 64 bit support files added in my build.
     
  11. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    318
    Yeah as the above post mentioned try setting to a specific version of 2017.4 rather than the "always use latest X" version. I just took a look and spotted what's going wrong here but at this point I probably can't deploy that fix until early next week.
     
unityunity