Search Unity

Android App Bundle - Google Play App Signing - What option do we use with Unity?

Discussion in 'Editor & General Support' started by SaturnCO, Dec 29, 2018.

  1. SaturnCO

    SaturnCO

    Joined:
    Nov 14, 2014
    Posts:
    11
    I'm eager to start using the new App Bundles release in Unity 2018.3 on my Android Game.

    And I applaud this pretty well written guide: https://blogs.unity3d.com/2018/10/03/support-for-android-app-bundle-aab-in-unity-2018-3-beta/

    I have a question though: What option on Google Play's App Signing page do we use with Unity?
    Screenshot from Google Play:

    (Existing game already on the Google Play Store using Unity's Keystore system)

    I don't want to screw up and end up in a situation where I'm locked out of uploading updates to my App because the key is set up wrong or something, so any guidance is appreciated.
     
    caglarenes likes this.
  2. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    31
    I have same problem. I didn't find any resources yet
     
  3. Ogien

    Ogien

    Joined:
    Nov 21, 2012
    Posts:
    156
    I am stuck at the same screen, what the heck do I do there
     
  4. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    31
    Okey, I solved it with these steps.

    1) First build your Google App Bundle with Unity. Use your usual keystore for signing.

    2) Build your game again but click "Export Project" this time on export settings.

    3) Open your exported project with Android Studio.

    4) Build your game again on Android Studio. It's simple. On topdown menu, follow Build > Build APK/Bundle > Build Bundle.

    5) Android Studio will ask keystore file location. Select your Unity-generated keystore and enter passwords etc. and click next.

    6) Select "Export encrypted key for enrolling publishing apps..." when you see it. This step will produce ".pepk" file before build. Press finish.

    7) Upload your .pepk file to Google Play Developer with first selection on your screenshot. You are ready to go.

    You can upload your Unity-generated or Android Studio generated game now. I uploaded my Unity-generated app bundle. Because my Android Studio knowledge is limited. I didn't trust Studio.

    I did these steps with my existing old .apk apps. I didn't see any updating or keystore problem. I think it's safe.



    You can also use Java-console for generating .pepk file but I think it's simplier.
     
  5. areavisuale

    areavisuale

    Joined:
    Jul 23, 2015
    Posts:
    44
    I don't have this option. I think there are some missing steps in your instructions...
     
  6. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    31
    Which version of Android Studio are you using? I'm using Android Studio 3.3.2.
     

    Attached Files:

  7. areavisuale

    areavisuale

    Joined:
    Jul 23, 2015
    Posts:
    44
    I updated Android Studio and now I have the option.
    But I continue to get errors... it seems related to gradle.

    The first problem is that if I open the project normally it isn't recognized as a gradle project. So I have to import it, instead of opening it (but when I import it I have different options to choose, gradle, android gradle... which is the correct one?)

    After that, when i build, it asks me to update the gradle plugin, but I cannot perform any update. In fact, when I go to file-> project structure, the android gradle plugin version and the gradle version are empty, and I cannot choose anything. If I write a number in the gradle version slot, and I close the window, Android Studio asks me to recreate the wrapper using the latest supported gradle version. In this way seems that the project now has gradle, but not the android gradle plugin.

    Did you do all these steps? I'm blocked now, too hard...
     
  8. ignasked

    ignasked

    Joined:
    Oct 29, 2016
    Posts:
    1
    I did get the same problem with it requiring me to update gradle but I couldn't just like you. But I have tried the other method. I followed this: https://medium.com/mindorks/securin...app-with-google-play-app-signing-24a3658fd319 .In short:
    1. Download the pepk tool
    2. Open it in CMD (The code provided in your google play console also opens the tool but you need to specify the correct path to pepk.jar file)
    3. Enter correct path to your keystore file. Then specify your alias (the one that you choose in unity after inserting keystore password). Specify output directory
    4. Press enter and then you will have to enter your keystore password and key password
    5. The new file will be generated in the directory that you chose, upload it to google play console.

    I have tried this and it seems that now I can update my uploaded games using app bundles
     
  9. areavisuale

    areavisuale

    Joined:
    Jul 23, 2015
    Posts:
    44
    Thank you verymuch! It works. It wasn't very clear, in particular because google insert $ before the code, that works only on Linux, so I had to delete it, and nobody says that in the output string you have to insert .pem as extension
     
    justinkmai likes this.
  10. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    218
    Ok, I just uploaded my first bundle and I didn't do any of this. I just uploaded, my aab file into google play console, which accepted it happily with no complaint and told me there were three apps in it, one for each android platform, 32, 64 and x86. However, It's been a day and it hasn't gone live yet. Did I do something very wrong here?

    EDIT: I have been using the normal Unity app signing for single apk previously. Moved to bundle to support the ARM64 platform.

    EDIT:2 My app is live and seems to work great. I let Unity gen the .aab file and put it in the play store as is.
     
    Last edited: Jun 7, 2019
  11. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    3
    On my side, I am trying to run these lines in command line (Win 10), But facing error
    Code (Boo):
    1. no main manifest attribute, in C:\Users\AsifN\Downloads\pepk.jar
    Could you help me how to handle it?
     
  12. Fuad-Ahmad

    Fuad-Ahmad

    Joined:
    May 24, 2013
    Posts:
    1
    I am using Android Studio 3.4.1 :
    Build > Build APK/Bundle > Build Bundle. NOT working; no option for keystore selection.
    the option will be Build > Generate Signed Bundle or APK > Android App Bundle
     
    M4RCIN and StefanoCecere like this.
  13. MackNugget

    MackNugget

    Joined:
    Dec 4, 2012
    Posts:
    35
    Thanks for the steps. Quick question. After step 4 I don't get an option for step 5. It just builds the app bundle. Any idea how I can get step 5 to show?

    I'm using the latest version of Android studio 3.4.2
     
  14. guneyozsan

    guneyozsan

    Joined:
    Feb 1, 2012
    Posts:
    63
  15. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    43
    Hi, i lost... I have same issue when using android studio, and then i tried using cmd. Everything was right but i get error like this:
    Please help

    EDIT: It solved now. The file output must be .pem
     
    Last edited: Aug 3, 2019
  16. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    Hi Caglarenes,

    Is it true that to build bundle, we have the use the "GRADLE" and not "INTERNAL" build (set in the Build System option) ?

    Can I still build bundle, with the INTERNAL build ?