Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Splitting application binary cause my scenes not to load.

Discussion in 'Android' started by Kulgann, Aug 6, 2015.

  1. Kulgann

    Kulgann

    Joined:
    Oct 17, 2014
    Posts:
    15
    Hi there, when using the split application binary option I get the following error java.io.FileNotFoundException: assets/build_info.txt. This cause the fire of another error that says the scene could not be loaded because it is not in the build settings. I'm 100% certain that all scenes are in the build settings and that my code is correct. When building the app without splitting the binary everything works fine. I have never encountered this type of error before. Just yesterday I made several build of my game and everything was fine. What happened?

    Update : restarting the device seems to magically solve the issue . The problem persists over multiple devices , even if the app is downloaded from google-play.
     
  2. jmorhart

    jmorhart

    Joined:
    Apr 28, 2015
    Posts:
    2
    I am having the exact same issue, unable to load any scenes other that the main scene when "Split application binary" is checked. I'm also encountering problems with Resources.Load, which I'm relying on heavily. The asset returned is always null. Does anyone know how to get Resources.Load and Application.LoadLevel working with .obb files?
     
  3. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    How are you guys implementing OBB functionality? Are you making sure you are naming the OBB files correctly? Does it work if you Build and Run?
     
  4. Kulgann

    Kulgann

    Joined:
    Oct 17, 2014
    Posts:
    15
    I'm naming my obb's the following way main.[versioncode].com.MyCompany.MyAppName. and no It does not work even if I build and run
     
  5. Kulgann

    Kulgann

    Joined:
    Oct 17, 2014
    Posts:
    15
    I noticed that Application.dataPath does not point to the correct location when the errors happens. Restarting the device or even running another app seems to fix the problem. What is happening ?

    Edit I read that the obb is not being added to search path in this thread http://forum.unity3d.com/threads/more-google-obb-drama.135224/.

    The unity guy also said to create a dummy activity but I have no idea how to do that. Can anyone help me out? And why does this only happen to one of my apps. The others build fine.
     
    Last edited: Aug 9, 2015
    Info-Gamer likes this.
  6. Info-Gamer

    Info-Gamer

    Joined:
    Aug 28, 2015
    Posts:
    3
    This worked!
     
  7. crypt0

    crypt0

    Joined:
    May 25, 2015
    Posts:
    55
    Hi,
    had the same problem last days - Add READ_EXTERNAL_STORAGE permission to you AndroidManifest.xml and it will work!

    Cheers
     
  8. brunokeith

    brunokeith

    Joined:
    Oct 29, 2013
    Posts:
    6
    I was stuck on this problem and after some time I find a solution: I was using a Unity version (2018.4.10) with a bug on the .obb loading. I am gonna post some info that I found.

    From Android expasion file: https://developer.android.com/google/play/expansion-files
    ... Since Android 4.4 (API level 19), apps can read OBB expansion files without external storage permission. However, some implementations of Android 6.0 (API level 23) and later still require permission, so you will need to declare the READ_EXTERNAL_STORAGE permission in the app manifest and ask for permission at runtime as follows:
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    For Android version 6 and later, external storage permission needs to be requested at runtime. However, some implementations of Android do not require permission to read OBB files...
    And then a Unity member said this: https://forum.unity.com/threads/how...eds-read-permission-to-access-the-obb.665785/
    ... Since Unity 2018.3 runtime permissions can be requested at any time during the runtime, not only at the start up. With that feature, we've made sure that when loading OBB file we will request the read external storage permission only if it is needed.
    And finally a bug fix: https://unity3d.com/pt/unity/whats-new/2019.1.0
    Android: Fixed the load failure of il2cpp player using OBB files (1124777, 1130918)