Does anyone know if the GooglePlayOBBDownloader (http://u3d.as/content/unity-technologies/google-play-obb-downloader/2Qq) is still required as of Unity 5.5?
I'm working on a game that's 500mb+. I'm building and uploading it as a split binary and it works fine without the GooglePlayOBBDownloader.
Can someone clarify why Unity says we should integrate the GooglePlayOBBDownloader (https://docs.unity3d.com/Manual/android-OBBsupport.html) when the game works perfectly without it?
Google Play will automatically install and download the OBB. If someone manually removes the OBB file from /sdcard/Android/obb/your.package.name Google Play won't automatically restore the file. So the game code would need to handle restoring the OBB.
Answer by andrew_2992
Nov 07, 2016 at 05:49 PM
Hello!! @tgraupmann @HOS I'm very interested in this thread, I just posted a topic myself about the same kind of issue. All of the tutorials and information regarding .obb downloader seems to be from around 2012 - 2013 and in some cases 2014... The lack of tutorials and resources makes me think that the whole thing has been deprecated. (also the main resource everyone is using is not good) (https://www.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/)
My main question is if people don't delete the .obb file after it has been initially downloaded, can I safely assume that their files will be automatically downloaded when they install the application?
Maybe there are some people in other continents that have very very old almost second hand refurbished phones and might run into a problem but is this kind of thing generally taken care of these days on modern devices automatically?
I found with Unity and split OBB, you'll want to make sure the App version and OBB version match. So when I upload a build to Google play, I always upload a new OBB file to make sure those versions match.
When the user installs via Google Play that will auto install the APK and OBB file that goes with it. But if there's not enough space for the OBB file, there's a chance it won't be available. So you'll need code to detect that.
In the Android SDK, in extras you'll find the sample code for the OBB downloader which you'll need to customize. Or you can use the Unity OBB downloader package. I used the custom OBB downloader option.
I have this all working and downloading in 2016. So it still works.
Answer by Carl201010
Dec 05, 2016 at 06:08 PM
I'm finding that the split OBB download from Google play is reliable, so @tgraupmann 's comments about file deletion make sense to me (thanks). However, I have an issue with certain devices not recognising the OBB file until they are restarted, which is very annoying. The OBB downloads correctly and is placed in the right location, but the APK cannot seem to call the OBB until the device is restarted. Then it's fine. Any ideas? Thanks.
I customized the OBB downloader in JAVA and the download completes before launching the Unity activity.
I'm seeing that the download has actually completed and installed, but still will not run - first time only. Going back through forums and comments I have the impression that Google have fairly recently improved the OBB process overall (as you say, requiring an upload that corresponds to the version but then auto-renaming it to the main.version.co.game format) and with Samsung devices at least not making the 'open' button available until after the app has installed. The loading bar from the play store correctly recognises the size of the complete package, APK + OBB. I can see where I might need to accommodate for the OBB not downloading correctly, but I can't see where to accommodate for the app not recognising the OBB until restart after the OBB has downloaded and seemingly installed correctly. I am perplexed...
You need to use a separate activity to download the OBB. When the OBB has been downloaded and verified, then you start the activity that loads Unity.
@Autonoma Unfortunately I have not. A little more detail: I created an initial scene that calls the 'rest of the game.' The scene contains only a single graphic and in this instance a Playmaker FSM that calls the main menu (I think the fact it's an FSM is neither here nor there, but anyway). On the initial download from Google Play, this scene does not load; it is presumably being lumped in with the 'rest of the game' when the binary split is performed. I am unclear as to how to prevent this from happening, or if in fact it is the root of the problem anyway. The reason I say that is that if the issue were Google Play, for whatever reason, not in the first instance finding the path to the FSM but finding it subsequently, then this is the kind of behaviour I would imagine. I take tgraupmann's point, but the use case he describes sounds very slightly different, in that I am convinced the APK is not being run before the OBB has finished downloading. I wish I could find out more about what Google Play does with the APK when it initially downloads it, because this seems to be where / when the problem occurs; I can see the OBB in the correct place (i.e. the location where it is subsequently found after re-starting) which makes me wonder about the APK. Anyway, I think it's going to take someone who knows more about Android than me to resolve this. All I know for certain is that it works fine on iOS - and sells a lot more there too. Hashtag Just Saying :)
That seems like it's a little different than my issue - my initial scene loads (from APK), but not the scene that is supposed to be in the OBB. However, restarting the device allows both the initial scene to load and the scene that's in the OBB. But this is only happening on some lower-end devices.. it's so weird.
And I hear you about iOS! :)
Same issue, and not on a lower end device, I have tested on a Samsung S7 and have seen this issue.
I uploaded a alpha empty project to Google Play with 2 nearly empty scenes, the obb is 200kb and it still fails to load after app install, it works after restart though.
Bug is driving me crazy...
Answer by theylovegames
You should use a custom activity to download the OBB. Upon completion, then launch the Unity activity. That way a restart won't be needed.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
108 People are following this question.
Google Play OBB Downloader crash with "android.content.res.Resources$NotFoundException: Resource ID #0x0"
Unity 3D split apk not loading the .OBB file
OBB here but app won't load it and stay on the first scene
print out the value (string) of the URL passed to the WWW in the google console
How to access files in Android OBB without WWW