Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Pixipulp · Jul 18, 2013 at 03:12 PM · androidsceneloadapkobb

Android Apk + Obb Splitting | Scene is not loading

Hi there,

as it seems I have a problem with splitting my application to .apk and .obb files. I have followed this tutorial and all went fine so far... I can create the spitted files and I can successfully download the .obb in my first scene.

But after the download I can’t load the next scene (which is inside the .obb as I assume). When it comes to loading the next scene I get the following error message:

Level '02_menues' (1) couldn't be loaded because it has not been added to the build settings.

I saw that I am not the only one expiring this problem, but I didn’t found any working solution.

So far I have tried things like:

  • using c# code only

  • putting all scenes in a "Resource" folder

  • removed all scenes from the build settings and added them again

  • rebuild and reuploaded the apk/obb to google several times

... but none of these things worked.... Crazy enough: if I push the app to the phone via Unity (build and run) it is working...but not if downloaded from Google. I don’t get what I’m doing wrong.


  • Unity Documentation regarding obb splitting

  • Asset store tool I use

  • The code I use:

    using UnityEngine; using System.Collections;

    public class DownloadObbExample : MonoBehaviour { private string expPath; private bool downloadStarted;

        void Start()
         {
             expPath = GooglePlayDownloader.GetExpansionFilePath();
         
             if (expPath == null)
             {
                 //Error
                 System.Console.WriteLine("\nOBB DOWNLOAD: External Path not found\n");
                 return;
             }
             else
             {
                 string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
                 string patchPath = GooglePlayDownloader.GetPatchOBBPath(expPath);
                 
                 System.Console.WriteLine("\nOBB DOWNLOAD: External Path: " + expPath +"\n");
                 System.Console.WriteLine("\nOBB DOWNLOAD: Main Path: " + mainPath +"\n");
                 System.Console.WriteLine("\nOBB DOWNLOAD: Patch Path: " + mainPath +"\n");
                 
                 if (mainPath == null)
                 {
                     System.Console.WriteLine("\nOBB DOWNLOAD: Main was null and OBB will be fetched now\n");
                     
                     GooglePlayDownloader.FetchOBB();
                     
                     System.Console.WriteLine("\nOBB DOWNLOAD: OBB has been fetched\n");
                     
                     StartCoroutine(loadLevel());
                 }
                 else
                     Application.LoadLevel("02_menues");
             }
         }
         
         protected IEnumerator loadLevel()
         {
             string mainPath;
             
             do
             {
                 System.Console.WriteLine("\nOBB DOWNLOAD: Trying to fetch main path\n");
                 
                 yield return new WaitForSeconds(0.5f);
                 mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
                 
                 System.Console.WriteLine("\nOBB DOWNLOAD: Main path = "+ mainPath + "\n");
             
             }
             while( mainPath == null);
              
             if(downloadStarted == false )
             {
                 System.Console.WriteLine("\nOBB DOWNLOAD: Load OBB from mainPath: "+ mainPath +"\n");
                 
                 downloadStarted = true;
              
                 string uri = "file://" + mainPath;
             
                 WWW www = WWW.LoadFromCacheOrDownload(uri , 0);
              
                 // Wait for download to complete
                 yield return www;
                 
                 System.Console.WriteLine("\nOBB DOWNLOAD: OBB loaded. Procede to next level...\n");
                 
                 Application.LoadLevel("02_menues");
             }
         }
    
    
    
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Brickit · Sep 25, 2013 at 09:08 PM 0
Share

Having same problem but $$anonymous$$e is sort of the same but different. The package downloads and installs and fetches the oBB but it still gets same message. I have spend ages on this now. I don't get why i cannot just upload a 100meg apk ins$$anonymous$$d.

http://forum.unity3d.com/threads/202360-Split-binaries-not-working-when-app-is-downloaded-from-play-store

avatar image Pixipulp · Sep 26, 2013 at 08:35 AM 0
Share

The obb and apk have to be from the same build (otherwise you will get the "scene not found" error. Furthermore it can take even longer than 3 hours to update the obb on the play store... so just try to wait a lil longer and then test it again. Hope this will work for you too. Unfortunately you won’t get around application splitting :(

avatar image Straafe · Oct 30, 2013 at 08:03 PM 0
Share

I'm still not even able to get my app to download the obb from google play... followed the same tutorial.

It says download complete 0.00kb/0.00kb and then loops back to the main scene with the fetch obb button, without having downloaded anything. Then, if I click fetch obb again it blinks to a black screen and back again. No idea what could be wrong..

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Pixipulp · Jul 18, 2013 at 08:22 PM

Well it seems that my problem has been solved by waiting for Google to update the .obb + .apk file. If anyone of you experience the same problems that just rebuild your apk and obb files and commit them to Google. You should then wait for about 1-2 hours and test your application download again.

As far as I can say, the first obb file you commit is available instantly, but if you update the apk and obb files it will take a while till they are available. In this period of time you will receive the wrong obb file and get the error described above (the apk you manually push to the device doesn’t match with the downloaded .obb).

Cheers!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Meltdown · Sep 28, 2015 at 03:52 AM

Try either of these two things...

In Player Settings, change the Install location to Force Internal and Write access to Internal only

To get it working with external access (i.e file read and write), I would suggest try adding the android.permission.WRITE_EXTERNAL_STORAGE permission to your Android manifest. (Although I haven't confirmed if this works). But my guess is if you don't have this permission, and because the files being accessed were in the OBB in External storage (default player setting), they weren't found.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by hollym16 · Sep 15, 2014 at 01:42 PM

I've got the exact same problem that Straafe describes. Mine can't be to do with waiting for Google to propagate it as I left it for a week and it quickly shows the download screen saying Download Finished then loops back to the first screen. Anyone been able to get around this?

EDIT: I think I found the problem with this; in Player Settings, I hadn't changed the Write Access to 'External (SDCard)'. Silly mistake, I know, but it makes a huge difference!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

obb apk scene load fail 1 Answer

Scene Load Problem in Android 0 Answers

apk +obb issue, the first scene is messy and the rest of the scenes can't load ! 0 Answers

How to work with (main|patch).obb ? 2 Answers

Application Level data not available inside OBB (Android) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges