Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 avirads · Oct 31, 2018 at 01:28 PM · sceneloadapkfailureobb

obb apk scene load fail

Due to large file size, i have split chosen to "Split Application Binary" to facilitate upload to play store. Unity creates 2 files, apk and obb and installation goes through when the option "Build and Run" is selected. Loading the 1st scene after the splash screens fails and the app hangs at this point.

I have seen many people face this issue and there are multiple solutions like manually renaming the obb file, or writing code to load the obb etc.

However i feel that this should be handled by Unity because it did the splitting for me. Infact i tried multiple approaches suggested online but none worked.

Hence i would like to know whats the latest steps to do to get this working.

Unity Version: 2018.2.3f1 Android: Nougat (>7)

Comment
Add comment · Show 1
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 avirads · Oct 31, 2018 at 01:30 PM 0
Share

Also using Vuforia 7.2.23

1 Reply

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

Answer by misher · Oct 31, 2018 at 02:08 PM

Make sure your first scene is included in apk and not in obb. If your first scene is big one, make new small scene for loading. Also there are problems for Vuforia traking configurations, they are automatically included to obb file and then Vuforia fails to load them, here is workaround, make sure to run it in your starting scene:

 using System.IO;
 using System.Collections;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 
 public class ObbExtractor : MonoBehaviour
 {
     [SerializeField]
     string[] filesInOBB;
 
     void Start()
     {
 #if UNITY_ANDROID
         StartCoroutine(ExtractObbDatasets());
 #endif
     }
 
     private IEnumerator ExtractObbDatasets()
     {
         foreach (var filename in filesInOBB)
         {
             string uri = Application.streamingAssetsPath + "/Vuforia/" + filename;
 
             string outputFilePath = Application.persistentDataPath + "/Vuforia/" + filename;
             if (!Directory.Exists(Path.GetDirectoryName(outputFilePath)))
                 Directory.CreateDirectory(Path.GetDirectoryName(outputFilePath));
 
             var www = new WWW(uri);
             yield return www;
 
             Save(www, outputFilePath);
             yield return new WaitForEndOfFrame();
         }
     }
 
     private void Save(WWW www, string outputPath)
     {
         File.WriteAllBytes(outputPath, www.bytes );
 
         // Verify that the File has been actually stored
         if (File.Exists(outputPath))
         {
             Debug.Log("File successfully saved at: " + outputPath);
         }
         else
         {
             Debug.Log("Failure!! - File does not exist at: " + outputPath);
         }
     }
 }
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

112 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 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 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 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 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 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 avatar image avatar image avatar image avatar image

Related Questions

Android Apk + Obb Splitting | Scene is not loading 3 Answers

Anyway to save which seen the player was on, then load that scene back from another one at a different time? 2 Answers

Load Scene by audio clip 2 Answers

Load Different Stages 1 Answer

How can I save the player's progress in-game? 1 Answer


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