Search Unity

Not possible to upload expansion OBB files to Google Play

Discussion in 'Android' started by angel_m, Nov 4, 2013.

  1. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Today I have uploaded my APK file to Google Play for testing but it is not possible to add any expansion OBB file. There is no option available in the development console.

    Any idea, what is happening? :eek:
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,443
    I haven't done multi-part APK deployment so far. Just to cover the obvious, did you read through this page? http://developer.android.com/google/play/expansion-files.html

    Does the Unit OBB system use the ADK Expansion API automatically for you? I would expect all the coding tips on that page to be inside the Unity executable core for Android. If so, perhaps you're missing something in your Manifest that marks it as requiring one or two expansion files, and thus enables the development console options related to expansion files.
     
  3. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    No, that is not the problem. Anyone has uploaded OBB files recently?
     
    XCO likes this.
  4. ZAAK

    ZAAK

    Joined:
    Oct 27, 2013
    Posts:
    8
    Hi angel_m

    I'm struggling with a similar issue too for over one week now. Welcome to OBB hell :-x

    Probably you need to switch to advanced mode in the APK panel of the Google Play Developer Console page.

    First you just upload the APK file, then you get to a new form where you can upload the OBB main expansion pack, and if needed a patch file, which I never tested myself. - Hope this helps!

    After the upload you should wait for several hours, until you can fetch the OBB...

    For testing purpose, you can also put the OBB file on your device over USB by using 'adb push main.<version>.com.<developer>.<app_name>.obb /sdcard/Android/obb/com.<developer>.<app_name>/' (that folder needs to be created manually) and 'adb install yourapp.apk' in the console... The app should find the associated OBB if it's put in the right place.

    I've tested Google's OBB Downloader plugin (http://u3d.as/content/unity-technologies/google-play-obb-downloader/2Qq), and it seems to download the file like expected to the same place as above, but we got problems afterwards with a plugin and all files in the StreamingAssets folder. The files from the OBB don't get extracted into the right folders somehow, at least in our case...

    Good luck!
     
    Last edited: Nov 4, 2013
    XCO likes this.
  5. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I have uploaded the APK file successfully but there isn't any form to upload the OBB file.
     
  6. ZAAK

    ZAAK

    Joined:
    Oct 27, 2013
    Posts:
    8
  7. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Actually, doesn't appear the option to upload OBB files in simple or advanced mode.

    BTW I do have followed the tutorial.
     
  8. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I have found a help page telling right now it is not possible to add a OBB file with the first APK . But then what can we do?
     
    Last edited: Nov 5, 2013
  9. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
    Upload one a drawft or publish as beta, create a new version, and upload again :p
     
  10. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Thanks.

    I have another problem, now:

    I am trying to use the Preloader script from the tutorial of this page:

    http://labs.exoa.fr/tutorial-unity-4...ogle-play-obb/

    But I get this error:

    Exception: JNI: Init'd AndroidJavaClass with null ptr!
    UnityEngine.AndroidJavaClass..ctor (IntPtr jclass) (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/Export/AndroidJavaImpl.cs:533)

    Any suggestion?
     
    Last edited: Nov 5, 2013
  11. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
  12. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Thanks but there isn't anything related to my problem in those references.
     
  13. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    same Problem as angel_m here too...
    my old app worked fine now with latest Unity Version i have the trouble...
    is there a solution ?
    thank you!
     
  14. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
  15. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    i'm using 4.2.2f1

    the problem is that the APP crashes when try to download the obb beside the Error in the Editor:
    Code (csharp):
    1. Exception: JNI: Init'd AndroidJavaClass with null ptr!
    2. UnityEngine.AndroidJavaClass..ctor (IntPtr jclass)
    3. UnityEngine.AndroidJavaObject.get_JavaLangClass ()
    4. UnityEngine.AndroidJavaObject.FindClass (System.String name)
    5. UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className)
    6. UnityEngine.AndroidJavaClass..ctor (System.String className)
    7. GooglePlayDownloader.RunningOnAndroid () (at Assets/Plugins/Android/GooglePlayDownloader.cs:12)
    8. GooglePlayDownloader..cctor () (at Assets/Plugins/Android/GooglePlayDownloader.cs:21)
    9. Rethrow as TypeInitializationException: An exception was thrown by the type initializer for GooglePlayDownloader
    so this error showed never up before...

    What version did u use when it worked ?
    thanks
     
    Last edited: Nov 12, 2013
  16. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
    I don't know. But probably something like 4.2.1. You are saying that it happens in the editor???
     
  17. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    Yes this Error Msg is from the Console...
    and the APP crashes on device when try to download the obb file...
    if i publish direct from Unity to Device (with obb) all works fine...
     
  18. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
    You cant run android or ios plugins inside of unity3d editor. If you didn't know about it, probably there is a ton of information that should help you in the basic documentation about plugins.

    http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

    Now, forget about editor, you must try to identify what is really happening in the device. What is the stack trace of the exception that crash?

    You can increase the jni output information by adding "AndroidJNIHelper.debug = true;" code before any call and set adb to check native calls "adb shell setprop debug.checkjni 1".
     
  19. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    yes i know that i can not execute android native code...
    but also the check fails...
    so i tried with Unity 4.3f3 same error
    UNity 4.2.1f1 same error
    sooo
    it has to do with the Android SDK the Google Plugin not communicating correctly...
    hmm i try your suggestion to debug the stuff... will report it here...
    I also did a clean Android SDK install...
    so publishing and running from Unity works fine....
    App runs without any issues... exept if i try to fetch the obb...
    Also the basic example fails...
    thxxxx
     
  20. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    is there anyone publishing an Android app using OBB files with success right now?

    Please,can give us any support?
     
  21. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    517
    Yup, I just uploaded a new build with 4.3 today. There shouldn't be anything to it. Make sure you're using a modern browser and it should work without issue.
    Make sure you're in "Advanced mode" in the APK uploader the button will say "Switch to Simple Mode" then when you upload an APK you should see an area below the APK where you can upload an expansion file. Upload your OBB there. Should work fine.
     
  22. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Thanks, this problem was solved, I meant the problem with the error we get when trying to fetch the obb using the Google Play OBB Downloader.

    Have you use that, recently, with success?
     
  23. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    i did some more test's but no success ...
    it looks that the issue is related to the SDK...
     
  24. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I think the same...
     
  25. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    517
    I use Unity's GooglePlay OBB Downloader too. As long as you set it up properly with the correct license key and give Google a couple of hours for the servers to update with the build that you upload there shouldn't be much else too it.
     
  26. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    well i have 4 App's in Store that uses GooglePlay OBB Downloader... all running fine...
    but now with latest SDK Unity 4 - 4.3 it doesn't work anymore...
    as you can see i'm not the only one...
    If i sent my old APP that works on Store to the Device the GooglePlay OBB Downloader works perfect...
    Now i did a new Build same content etc... it doesn't work!
    Also if i do a new Project and use the Demo Script with my key it doesn't work!!!!!!
    So plz if someone get it to work plz help us... i really need to Update the APP in Store.
    many thxxx

    logcat Output when the App quits on Device:

    Code (csharp):
    1. D/dalvikvm(  197): GC_CONCURRENT freed 2253K, 69% free 15608K/50183K, paused 4ms+10ms
    2. I/BootReceiver(  197): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
    3. I/DEBUG   (  104): !@dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_native -m 11609
    4. I/dumpstate(11640): begin
    5. D/MPLSensor(  197): cb_onMotion:2
    6. D/VoldCmdListener(   99): asec list
    7. D/VoldCmdListener(   99): CommandListener::AsecCmd::runCommand -> --
    8. V/AlarmManager(  197): waitForAlarm result :8
    9. V/AlarmManager(  197): ClockReceiver onReceive() ACTION_TIME_TICK
    10. D/KeyguardUpdateMonitor(  197): received broadcast android.intent.action.TIME_TICK
    11. D/KeyguardUpdateMonitor(  197): handleTimeUpdate
    12. D/STATUSBAR-Clock(  281): onReceive() - ACTION_TIME_TICK
    13. I/dumpstate(11640): done
    14. D/STATUSBAR-Clock(  281): updateClock :10:25
    15. D/STATUSBAR-Clock(  281): onReceive() - ACTION_TIME_TICK
    16. I/DEBUG   (  104): gotoUploadUserFault called
    17. D/STATUSBAR-Clock(  281): updateClock :10:25
    18. I/AudioPolicyManager(  110): stopOutput() output 1, stream 3, session 552
    19. D/MPLSensor(  197): setDelay : handle=4, delay=66667000
    20. I/        (  197): mpu3050_suspend: suspending sensors to 0000
    21. I/        (  197): mpu3050_suspend: Will resume next to 0070
    22. W/InputDispatcher(  197): channel ~ Consumer closed input channel or an error occurred.  events=0x8
    23. E/InputDispatcher(  197): channel ~ Channel is unrecoverably broken and will be disposed!
    24. I/ActivityManager(  197): Process app.processName (pid 11609) (adj 0) has died.
    25. W/ActivityManager(  197): Force removing r: app died, no saved state
    26. I/MPL-ml  (  197): Actual ODR: 25 Hz
    27. I/        (  197): mpu3050_resume: Resuming to 0070
    28. D/Zygote  (  108): Process 11609 terminated by signal (11)
    29. I/AudioFlinger(  110): stop output streamType (0, 3) for 1
    30. D/AudioHardware(  110): AudioStreamOutALSA::setParameters() stop_output_streamtype=3
    31. W/InputDispatcher(  197): Attempted to unregister already unregistered input channel
    32. I/WindowManager(  197): WIN DEATH: win
    33. I/WindowManager(  197): WIN DEATH: win
    34. I/WindowManager(  197): WINDOW DIED windowState
    35. D/Launcher(  430): onRestart
    36. D/Launcher(  430): onStart
    37. D/Launcher.HomeFragment(  430): onStart
    38. D/Launcher(  430): onResume
    39. E/Launcher(  430): Error finding setting, default accessibility to not found: accessibility_enabled
    40. D/Launcher.HomeFragment(  430): onResume
    41. D/MenuAppsGridFragment(  430): onResume
    42. D/ProgramMonitor(26689): START onReceive()_intent : Intent { act=com.sec.android.intent.action.HOME_RESUME flg=0x10 cmp=xxxx }
    43. D/ProgramMonitor(26689): LAUNCHER_RESUME
     
    Last edited: Nov 14, 2013
  27. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    it looks like i found the issue... in my case...
    I did a complete Android SDK reinstall....
    the important step was to delete the .Android folder.
    Then install the new SDK + Google Play OBB Downloader in SDK.
    Now the Google Play OBB Downloader Demo works....
     
  28. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
    Good to know. Thanks to post.
     
  29. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I have tried that and now I can fetch the OBB file, but after that, the tablet shows a black screen and nothing happens I mean the next level of my App does not load...
     
  30. Sisso

    Sisso

    Joined:
    Sep 29, 2009
    Posts:
    196
    Guy, you need to give more information, it is already difficult try to help with no touch with the problem. A black screen say almost nothing.

    How do you know that it was downloaded? What is the code the identify that a OBB file is loaded and it is ok? Are you able to load any asset from Obb? Have you called Application.LoadLevel after you identify that OBB was loaded? Its failed before or after load a new level? What exceptions are you seeing in the logs?
     
  31. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    Then your obb is not the same as the apk file.
    If you build your app you have to use exactly the same obb apk to upload to google...
    then do adb install the apk to device ... wait 3 hours and run... should download and if your coroutine is working correct start the level.
    If the obb apk are not from same build you get Black Screen!
    Hope this helps.
    if not post your obb don loader code here...
     
  32. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    The obb is downloaded successfully but then I only get a black screen.
    I am using the modified "DownloadObbExample" script from the tutorial from this site:
    http://labs.exoa.fr/tutorial-unity-4...ogle-play-obb/

    This is the script, I use:





    "MyNextLevel" is not loaded...
     
    Last edited: Nov 14, 2013
  33. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    try Application.LoadLevel(1); instead nextScene.
     
  34. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160

    It doesn't work :(

    Please can you tell me what obb downloader script are you using?
     
  35. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    here is my script...
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class CheckOBB : MonoBehaviour {
    5.  
    6. public GUIText uitext;
    7.  
    8.     void Start () {
    9.  
    10.         if (!GooglePlayDownloader.RunningOnAndroid()) {
    11.       Application.LoadLevel (1);
    12.       return;
    13.     }
    14.  
    15.         string expPath = GooglePlayDownloader.GetExpansionFilePath();
    16.         if (expPath == null)
    17.         {
    18.             StartCoroutine(NoStorageX());
    19.         }
    20.         else
    21.         {
    22.     string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
    23.     if (mainPath != null) {
    24.     Application.LoadLevel (1);
    25.     return;
    26.     }
    27.     if (mainPath == null)   {
    28.       uitext.text = "Need to Download Media. Please Stay Connected!";
    29.       uitext.material.color = Color.black;
    30.       StartCoroutine(LoadMyLevel());  
    31.         }
    32.         }
    33.  
    34.     }
    35.  
    36.     protected IEnumerator LoadMyLevel() {
    37.     string expPath = GooglePlayDownloader.GetExpansionFilePath();
    38.     string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
    39.  
    40.     yield return new WaitForSeconds(1.5f);
    41.  
    42.     GooglePlayDownloader.FetchOBB();
    43.    
    44.     while( mainPath == null){
    45.       mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
    46.       yield return new WaitForSeconds(0.5f);
    47.     }
    48.     if (mainPath != null) {
    49.       Application.LoadLevel(1);
    50.     }
    51.   }
    52.  
    53.   IEnumerator NoStorageX() {
    54.   uitext.text = "No Storage is Available! Please insert SD-Card";
    55.   uitext.material.color = Color.red;
    56.         yield return new WaitForSeconds(20);
    57.         Application.Quit();
    58.     }
    59.  
    60. }
    61.  
     
    Ramsdal likes this.
  36. gamescorpion

    gamescorpion

    Joined:
    Feb 15, 2014
    Posts:
    132
    Here is what I did and got it all up and running:

    FIRST BEFORE YOU BEGIN!!!!!!!!

    1. MAKE A BACKUP OF YOUR ENTIRE PROJECT!!!!!

    2. MAKE DAMN SURE YOU MADE A BACKUP!!!

    3. Okay now first check if you already have an Android folder in your Plugins directory. If you do, then you will be doing a MERGE of AndroidManifest.xml. If not, you can move right onto step 4.
    IF NOT, then you need to make a backup of the AndroidManifest.xml file. Make a copy which we will come back to later on. NOTE: DO NOT MOVE ONTO IMPORTING UNTIL YOU HAVE MADE A COPY!!!

    4. Okay now import the OBB Asset from the asset store => https://www.assetstore.unity3d.com/en/#!/content/3189

    5. Now I want you to open the AndroidManifest.xml file (NEW ONE) and go side by side with the old COPY you made. SPECIFICALLY add the differences to the OLD one from this new one you got from the OBB asset. Specifically the main lines you need to have are the following:

    Code (csharp):
    1.  
    2.   <!-- patched manifest starts here -->
    3.   <activity android:name="com.unity3d.plugin.downloader.UnityDownloaderActivity" />
    4.   <service android:name="com.unity3d.plugin.downloader.UnityDownloaderService" />
    5.   <receiver android:name="com.unity3d.plugin.downloader.UnityAlarmReceiver" />
    6.  
    6. Next, when it imports follow all the steps from the reference site: http://www.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/

    7. Finally do the compile (I was able to compile this successfully using Unity Pro Android 4.5.3.f3 and using Android API 9.

    8. Now if you get ERRORS about the Progress bar (IapProgressBar) then simplly open up the progress_dialog.xml file (Android/res/layout/progress_dialog.xml) and go and change line 18 where it says progress bar from style="@style/IapProgressBar" TO style="@+id/progressBar"

    9. Do the recompile, then following the instructions as per step 6. It took me several hours to get it up and running as I created new scenes for this PLUS you have to wait for Google to process your file.

    Hope this helps :)

    God Bless!

    Nav
     
  37. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Why are you all complicating things.
    Unity Build Options -> Tick Split Binary tickbox
    Goto google console, switch to ADVANCED mode first. (IMPORTANT)
    Then upload game.apk
    It then ask you for expansion file, select your .OBB file
    Upload .OBB
    Done
     
  38. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    Hi this works but when i uploaded it in android store it dont working i think because i must use the
    Google Play OBB Downloader???!!

     
  39. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    No , wtf google obb downloaded got to do with it... When you say it dont work? What exactly do you mean? I bet you did not set the permissions correctly to insall on externAl sd card etc...
     
  40. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    no no your right i have forget to reupload a new apk and than i can upload obb
     
  41. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    I have yet had to use OBB files but I'm going to have to for my current game in progress. Why are some people using some type of downloader plugin when you say you just have to tick the binary split and upload the files and everything works perfect?
     
  42. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    I think when somone see your game in the play store he see first how big is the file when the file is more than 50mb he dont download it and wait when somone give a rewiev (i will made this always when i on my mobile internet)

    Other think is when you wants to update your games you can change this quickly than when you use the playstore (you must wait 4-6 hours for the new update)
     
  43. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    So it's just a difference of having Google Play handle the extra OBB files versus hosting them on your own server or something?
     
  44. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    This diffenrent is google play free and your own server not free