PlayerStore .apk + .obb loaded but cannot load scene

Hi,

I have uploaded a beta version of my app to the Google PlayStore. I splitted the app into a .apk and .obb file with the unity PlayerSettings option. Then, I renamed the apk file to com.companyname.appname.apk and the .obb file to main.6.com.companyname.appname.obb. 6 is my Bundle Version (I tested it to upload a version with 1 but google changed the name automatically to the current bundle version).

I uploaded both files to the Playstore by creating a new bet version. (That was yesterday). So, when I download the app, it downloaded the .apk and the .obb file. I can see the .obb in:

InternalStorage/Android/obb/com.companyname.appname/main.6.com.companyname.appname.obb

I started the app and want to load a second scene, but nothing happens, the app crashed. This morning I started the app and it works -_- on two devices. Then, I uninstalled the app on one device, downloaded it from the Google PlayStore and…it doesn’t work again. What the hell is that?

If I use the Build and Run option in Unity, it works - and the obb file is on the same location with the same name, as I downloaded it from the PlayStore.

I have read some articles

What’s going wrong? What can I do?

Thanks and Cheers

There was an issue reported when the OBB doesn’t work until you reboot your phone. Check if this is true, if it is - you might require additional permissions, probably READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE (dangerous permission).

I didn’t have a clear evidence and repro of this issue - so can’t tell you for sure or fix it properly.

Hi,

I tested it - I restarted my smartphone an started the app and it works. Then I uninstalled it again, downloaded it from the playstore, start the app → crash. I started the app again without a smartphone restart and it works :eyes: I uninstalled it, downloaded, installed and start → crash. Restart app, it works…:hushed:

That#s really strange!

Okay, but why EXTERNAL? My file is stored on the internal storage.

Cheers

The OBB gets downloaded to the external storage.
Can you please check with the permissions and say whether it works for you with either of the permissions?

The same problem. Do you have solution?

Seems like a simple way to do this - Android Internet permission in Unity - Stack Overflow
I will try and I will say if it works

Hi,

I added the READ_EXTERNAL_STORAGE permission to my Manifest file and it works.

Thanks and Cheers

2 Likes

@crypt0 thanks for the heads up!

1 Like

I have added READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE and it’s still not working for me. I have tried with unity 5.6.0p4, and 5.6.2p4. When I build to the phone it works fine, but when I upload it to google play and download from there I can’t get to any data in the OBB until I restart the phone.

1 Like

Hi Guys, i’m stucking on a similar problem with my project. I’ve used the latest plugin at Over17 Github repository for my project. My project has a first scene(0) with the obbdoebloadexample script and a coroutine that load the scene(1) after the FetchOBB. All the download part works fine, and the OBB is properly downloaded in the right path. Unfortunately, it does not load the scene(1). I get a nlack screen. I’ve attached the debug in android studio and i receive an error unable to extract assetbundle at file:///Android/obb/packagename/main.2.packagename.obb. I’ve also in my manifest the READ AND WRITE PERMISSION. And the taglrget set to api 26 according with the latest version of plugin. So, i think that something is wrong in my inplementation. There is someone that can share an example of working download script that load next scene after obb fetch ? I’ve also tried to restart the phone as i read in this post, but nothing changes. I’m not a better programmer and i mindly ask if someone can help me sharing a working code for this part in order to be sure that the code works. Hoping that someone can help me for this urgent task because my app needs to be published on this week. Thanks in advance to all. Best regards Max

1 Like

Maybe more details about your error will be helpful - like, logcat of the error and few entries around.

I’ve been having the same issue. The solution, though strange, was to remove my AndroidManifest file from within Unity. Unity generated it’s own file and there should be no need to replace it with your own.

Hello, first of all thanks for the GitHub plugins and all the threads to reach OBB status (almost)! :slight_smile:

Im since 2 hours thinking why my game doesn’t want to load an Scene,
with OBB in the middle.
(game is published on Google Play and working, i want to do an update).

It seems i’ve followed all steps (2 days or more but all super clear) with Split APK, AndroidPermissionsUsageExample, DownloadOBBExample and Uploading everything to Google Play in Beta.

I’ve managed to Download my first 25mb APK and the OBB (192mb).

Version number, good.
All seems good.

I download from Beta as a Tester. I update my game, Unity Starts,
i see the Permissions Dialog, i agree.

OBBDownloader starts (i feel OBB was already downloaded by google
but the OBBDownloader starts anyway, i will check that part)
and the OBB seems to be there.

I run inside one of my scripts this as one user posted to check SceneNames:

public void PrintSceneNames()
{
for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++)
{
var path = SceneUtility.GetScenePathByBuildIndex(i);
var sceneName = System.IO.Path.GetFileNameWithoutExtension(path);
Debug.Log(sceneName);
escenas.text+=“\n” + sceneName;
}
}

…And i see all the Scenes inside the OBB. BUT, it doesn’t load what is working
without OBB. (im testing it without OBB and the scene is right).

If i erase the App and i dont install the OBB (installing my first 25mb APK manually over
Airdroid), the Scenes are not there. So, that means, Unity and Android is reading
the OBB and content. (in theory).

Now, as im unable to see LogCat (i’ve tried many) as this is not a Rooted Phone
and ADB filtered with Unity doesn’t show me nothing more than Samsung data,
THEN,

Im stuck. :hushed::hushed:

Any clue why my game doesn’t load now? It seems im unable to make both OBB work
and now without Logs…:eyes:

…please help! :slight_smile:

Update: i see the OBB inside Android/OBB/mygame/…

It was downloaded on Internal Storage.

Why it doesn’t load the Scene? . . . :frowning:

Update (after coffe and 2 hours more): At least im seeing LogCat over ABD with… (to others having the same silly situation of not seeing logs when you stump with OBB and you don’t remember even your name):
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG

Trying to make the OBB work, more data:
https://issuetracker.google.com/issues/37075181

Update: I keep stuck with the OBB loading something…no matter what.

Have you tried restarting the phone after downloading the OBB from the store? I’ve seen a strange permission issue with reading from the OBB, but restarting the phone has always seemed to sort this. It also only seems to affect apps while in Beta mode…

Hi Dover8, nice to meet you.

Yes, i tried and tried and i will keep trying. :slight_smile:

Im pushing with Build&Run and doing some checklists until
i found the thing.

Sometimes, it loads…sometimes, it not…

Hi Yuri-Habets

After more research i have some doubts.

  • It’s API 19 good for the Permissions to work inside Android 6 or do we need to go up to API 22-23?

  • Do we have to put Write External Storage inside Build Settings?

Thanks!

Hi Dover8,

What do you mean by removing Android Manifest? :smile:

Did you built just with the Staging Area one that gets merged ?

Update about this: If i desinstall the Game and put Build&Run (with Split, permissions, everything), it works. Lol. Now let’s try again with the AndroidPermission Plugin and DownloaderPlugin (that doesn’t worked before to me, sorry my english). This is of course, an Android Bug as stated everywhere. Pew.

Update again: Now without changing nothing just the order of some scene, im getting
“Unable to convert Classes to Dex…”. Sometimes i receive this one. So, maybe the SDK Tools needs to be Updated now (after backup) and maybe some plugin is crashing everything.

Update Update: Now it seems to work…something is unstable with SDK Build-Tools 25
and Unity 5.6. Maybe is time to me to Update as i think in the future you are with 2018 :sunglasses:.
I didn’t changed anything and now it runs!!! (at least 1 time, i will keep testing before updating this to players).

What it works:

DownloaderOBB plugin: Downloads ok, Checks Path ok, as expected.

AndroidPermissions Plugin: It asks for them, it works (no restart phone here), as expected.

Some Google bug maybe…

Now i will commit this to Google maybe tomorrow and i round this post with
my experience with this.

What a long journey! Thanks Yuri-Habets and everyone! If it doesn’t work
tomorrow, i will keep with testing and checklists as now i think i understand
a little more.

Update Update Update: Ok, it works. :):slight_smile:

1 Like