OBB Download Not Working

I’m trying to use the (rather unfriendly) GooglePlayDownloader script and the built-in Application Binary Splitting support to try and prepare our game for Google Play.

The build splits the binary properly. I update the .apk and .obb to Google Play and publish a beta. I can download this beta from the Google Play Store and it works.

HOWEVER, I have some significant problems testing the code. The main one is that he .obb downloading repeatedly fails and ultimately gives up with a “download failed because the resources could not be found” error.

The way I am trying to test this is as follows

  • Download game from Google Play
  • Manually delete .obb file from local storage
  • Run game

My code calls GooglePlayDownloader.FetchOBB() if the application fails to find the OBB locally (using GetMainOBBPath).

Then the app seems to get caught in a cycle of trying to find the .obb to download and failing repeatedly.

This is what the log looks like:

I/Unity   (14583): FETCH OBB NOW
I/Unity   (14583): 
I/Unity   (14583): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 56)
I/Unity   (14583):
I/ActivityManager(  508): START u0 {flg=0x10000 cmp=com.tigerstylegames.spider2/com.unity3d.plugin.downloader.UnityDownloaderActivity (has extras)} from pid 14583
D/dalvikvm(14583): GC_CONCURRENT freed 415K, 6% free 7966K/8420K, paused 5ms+3ms, total 31ms
D/dalvikvm(14583): GC_FOR_ALLOC freed 2K, 6% free 7974K/8420K, paused 16ms, total 17ms
I/dalvikvm-heap(14583): Grow heap (frag case) to 19.820MB for 12582928-byte allocation
D/dalvikvm(14583): GC_FOR_ALLOC freed <1K, 3% free 20262K/20712K, paused 18ms, total 18ms
D/dalvikvm(14583): GC_CONCURRENT freed <1K, 3% free 20262K/20712K, paused 2ms+3ms, total 19ms
D/LVLDL   (14583): Service Bound
I/LicenseChecker(14583): Binding to licensing service.
I/Keyboard.Facilitator( 9309): onFinishInput()
I/ActivityManager(  508): Displayed com.tigerstylegames.spider2/com.unity3d.plugin.downloader.UnityDownloaderActivity: +1s175ms
I/LicenseChecker(14583): Calling checkLicense on service for com.tigerstylegames.spider2
I/LicenseChecker(14583): Start monitoring timeout.
I/qtaguid (10807): Failed write_ctrl(u 44) res=-1 errno=22
I/qtaguid (10807): Untagging socket 44 failed errno=-22
W/NetworkManagementSocketTagger(10807): untagSocket(44) failed with errno -22
I/LicenseChecker(14583): Received response.
I/LicenseChecker(14583): Clearing timeout.
W/LVLDL   (14583): Aborting request for download main.2.com.tigerstylegames.spider2.obb: http error 403
W/System.err(14583): com.unity3d.plugin.downloader.b.o: http error 403
W/System.err(14583):     at com.unity3d.plugin.downloader.b.k.a(Unknown Source)
W/System.err(14583):     at com.unity3d.plugin.downloader.b.p.a(Unknown Source)
W/System.err(14583):     at com.unity3d.plugin.downloader.b.g.handleMessage(Unknown Source)
W/System.err(14583):     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err(14583):     at android.os.Looper.loop(Looper.java:136)
W/System.err(14583):     at android.os.HandlerThread.run(HandlerThread.java:61)
I/LicenseChecker(14583): Binding to licensing service.
I/LicenseChecker(14583): Calling checkLicense on service for com.tigerstylegames.spider2
I/LicenseChecker(14583): Start monitoring timeout.
I/qtaguid (10807): Failed write_ctrl(u 44) res=-1 errno=22
I/qtaguid (10807): Untagging socket 44 failed errno=-22
W/NetworkManagementSocketTagger(10807): untagSocket(44) failed with errno -22
I/LicenseChecker(14583): Received response.
I/LicenseChecker(14583): Clearing timeout.
W/LVLDL   (14583): Aborting request for download main.2.com.tigerstylegames.spider2.obb: http error 403

That bottom section, where it errors out and then restarts the download, loops about 20 times before the application gives up for good.

Why is it “aborting request” with a 403? I have triple-checked my AndroidManifest, but maybe something is missing there that is interfering with my permissions?

Anyone?

This is fairly frustrating. This is software provided by Unity for a critical task, which is poorly documented, has a super opaque implementation, and is failing for mysterious reasons. Not to mention the fact that turning around new builds in Google Play literally takes HOURS…

My next step – given the seeming unlikelihood of receiving any guidance here – will be to build an empty project with enough content to warrant OBB splitting and try submitting that to Google Play, which will take hours. Ugh.

We’re also hitting the 403 Forbidden on our OBB download as well. We uploaded the APK about 16 hours ago, and I can download the whole APK+OBB just fine and the game works, but the OBB Downloader from the App Store just gets stuck on 403 Forbidden anytime it tries to download the OBB file separately. Extremely vexing.

And If there is a solution for this problem? I encountered the same question, and I get a 403 error when downloading the obb file.

I haven’t heard of any solutions thus far, nor have I gotten around to the soul-crushing task of trying to reproduce the failure in a brand new test project.

Can’t figure if it’s disheartening or encouraging that others are running into the same problem. Maybe something changed on the Google side of things that is making the downloader suddenly non-functional?

I’ve been battling with this same issue for days now, and we’re nearing a deadline on a product launch. I’ve tried running in the Alpha and Beta channels, without luck in either, and on multiple devices under multiple accounts. I’m also seeing the original poster’s behaviour of getting the loop about 20 times with the 403 errors, but something else I spotted is that the retry mechanism begins to fail when a 429 (Too Many Requests) is returned by the Google Servers.

Well, I’m glad I’m not the only one!

I just created a new, empty project, turned on binary splitting and set it up to use the “DownloadObbExample” script provided by the Unity package, so I’m just waiting for the thing to propagate and will see what happens next. Finger’s crossed?

Nope, same ding-dang problem. Unbelievable. Well, I guess I’ll report a bug now that I have it isolated in its own project.

Submitted bug #721021

For others having trouble in this thread – are any of you trying this with an APK “in production”? My app is in beta, and I’m wondering if switching it will have any impact. (I would hope not, since then how am I going to test it… but it might be worth a shot)

I tried switching between Alpha and Beta channels to see if that would make a difference, but haven’t pushed to Production as this is a client project and I can’t.

Good job getting it isolated, do you have a direct link to the bug tracker by any chance? I need to be able to tell our client that the problem is genuinely out of our hands at this point.

Hey Murcho,

Does this link work for you?

http://fogbugz.unity3d.com/default.asp?721021_n1l2ugmv9h4fbsp8

I wish I had a better idea for how to get somebody at Unity to look at the problem, but I often feel like they barely look at their own forums. I’m also going to see if I can track down a place to report the issue to someone at Google in case they might have some insight.

Will try the “move dummy project to production” test tomorrow as well and will report back.

Yep that link works well, thanks.

Back around June I implemented the Google OBB downloader into an existing published game I had.

I just tested it by downloading game, deleting OBB, then opened game again, and it started downloading OBB from Google server no problem…

About an hour ago I received word from a playtester that it suddenly started working.

It also suddenly started working here. WTF? It was just broken on the back-end for a week?

Well, that’s good news I guess?? Murcho, things working for you yet?

I even got word from a contact at Google Play that they fixed a bug internally this morning. Terrific news!

So you think when I tested it this morning, it worked because something was fixed… but if I would have checked yesterday it would probably not have worked? Again, mine was working published great in June, and had no reason to check it again until this morning.

Yes, that is the case.

Again: I got word from a contact at Google that they fixed a bug with OBB downloading. I had been experiencing the bug for over a week. It is fixed in both my real project and my fake repro project.

Holy moly, and now it suddenly magically works, just as other folks have corroborated!

That’s really frustrating that they had such a breaking bug and hadn’t mentioned it anywhere :frowning: Even contacting Google they just gave me the runaround. Still, glad it works, and thanks to davekalina for doing some heavy lifting here.