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 FriedrichWessel · Sep 14, 2012 at 12:08 AM · assetbundledownload

Problems get OBB File form GooglePlay Store

Hello everybody!

I´ve working for two Days on this Problem know, and dont get even closer. So I´m really appriciate if somebody could give me a hint. Thanks in advance!

In a nutshell: I have an apk thats bigger than 50MB I want to use OBB file + assetBundle to adress this problem. AssetBundle Loading is working if I copy the odd file with the right name in the right Folder. But if I try to get the OBB file from GooglePlay, I see: Download -> Download finished, but I still dont get any data, and I´ve no idea why.

Whole Project can be found here: https://github.com/FriedrichWessel/TestOBB

 Important Code: 
 
     using UnityEngine;
     using System.Collections;
     using System.Collections.Generic; 
     
     public class AssetStorage : MonoBehaviour {
         
         
         public static AssetStorage Instance{
             get; 
             set; 
         }
         
         //public string[] PrefabNames; 
         public string prefab = "Penguin"; 
         public string AssetBundleName; 
         public string message = "NONE"; 
         //private Dictionary<string, AssetBundleRequest> requests = new Dictionary<string, AssetBundleRequest>(); 
         private AssetBundleRequest request; 
         
         private string mainPath; 
         private string expPath; 
         private WWW www;
         
         void Awake() {
             DontDestroyOnLoad(gameObject);
             
             if(Instance == null)
                 Instance = this; 
             
         }
         
         void OnDestroy(){
             //Instance = null; 
             Debug.LogError("Destroy");
         }
         
         
         
         // Use this for initialization
         void Start () {
             if(GooglePlayDownloader.RunningOnAndroid()){
                 expPath = GooglePlayDownloader.GetExpansionFilePath();
                 message = expPath; 
                 mainPath = string.Empty; 
                 if (expPath == null){
                     message = "External storage is not available!";
                     Debug.Log("External storage is not available!");
                 } else {
                     message = "Try get MainPath" ; 
                     Debug.Log(message);
                     mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
                     Debug.Log("Main Path after first Fetch: " + mainPath);
                     message = "MainPath: " + mainPath; 
                 }
                 
                 if(mainPath == null){
                     message = "OBB not available - download!"; 
                     Debug.Log(message); 
                     GooglePlayDownloader.FetchOBB();
                     mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
                     message = "OBB Fetch finished" + mainPath; 
                     Debug.Log(message); 
                 }
             
             }
             StartCoroutine(Load());     
             
         }
         
         IEnumerator Load(){
             
             string filePath = string.Empty; 
             if(GooglePlayDownloader.RunningOnAndroid()){    
                 bool testResourceLoaded = false;
                 int count = 0; 
                 while(!testResourceLoaded) {     
                     
                     mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
                     
                     //Debug.Log("Main Path after Fetch: " + mainPath);
                     if(mainPath != null){
                         testResourceLoaded = true; 
                         //Debug.Log("Found Main Path: " + mainPath);
                         break; 
                     }
                     count++; 
                     if(count > 60)
                         break; 
                     yield return new WaitForSeconds(0.5f); //Let's not constantly check, but give a buffer time to the loading
     
         
                 }
                 
                 if(!testResourceLoaded){
                     message = "Connectionion Timeout"; 
                     Debug.Log(message); 
                 }
                     
                 else{
                     
                     message =  "Loading Finished";
                     Debug.Log(message); 
                 }
     
         
                 if(mainPath == null){
                     message = "MainFile still not found!"; 
                     Debug.Log(message); 
                     
                 }
             
                 filePath = "jar:file://" + mainPath;
                 filePath += "!/"+AssetBundleName+".unity3d";
                 
                 
             
             } else {
                 filePath = "file://" + Application.dataPath; 
                 filePath += "/"+AssetBundleName+".unity3d"; 
                 
             }
                 
             
             
             message = "FilePath: " + filePath; 
             Debug.Log(message); 
             
             
             www = WWW.LoadFromCacheOrDownload(filePath,0); 
             yield return www;
             var bundle = www.assetBundle; 
             if(bundle == null)
                 Debug.Log("bundle == 0"); 
             
             Instantiate(bundle.Load(prefab, typeof(GameObject))); 
     
         }
         
         public string InstancePrefab(string name){
             /*if(requests.ContainsKey(name)){
                 Instantiate(requests[name].asset); 
                 return ("Finished loading: " + name); 
             } else 
                 return ("Asset not found: " + name); */
             //Instantiate(request.asset); 
             
             return ("Instance Finished: " + name ) ; 
         }
         
         void OnGUI(){
             GUI.Label(new Rect(10, 10, Screen.width-10, 20), message);
         }
         
         
         
     }
     

Thanks again !

Friedrich

P.S.: I get all the information from these links here:

Android Expansion Files: http://developer.android.com/guide/google/play/expansion-files.html#Testing

Usage of the OBB Plugin http://forum.unity3d.com/threads/150095-Split-APK-amp-Google-Play-OBB-Downloader-Question

Add License to the Google Play Account: http://developer.android.com/guide/google/play/licensing/index.html

Comment
Add comment · Show 6
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 DerWoDaSo · Oct 29, 2012 at 11:31 AM 0
Share

I got the same problem... I cant find nothing in the log files. Have you found a solution?

avatar image FriedrichWessel · Oct 29, 2012 at 07:31 PM 0
Share

Hey, I didnt test anything - because I switched to Download from my own Server. But somebody told me that there is a second GooglePlay Store Plugin in the AssetStore, which is for Authentification. I´m pretty sure that this is the thing I´m missing. Would be nice if you post here if it is so.

avatar image Sisso · Sep 25, 2013 at 01:09 PM 0
Share

@FriedrichWessel, have you solved it? Your github version is functional?

avatar image FriedrichWessel · Sep 25, 2013 at 03:33 PM 0
Share

not realy :) I worked around it by download Assetbundles from a custom server ( or S3 ). But the answer down from DerWaDoSo sounds reasonable.

avatar image Sisso · Sep 25, 2013 at 09:06 PM 0
Share

I have managed to get it working, but I am not using Asset Bundle.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by DerWoDaSo · Oct 30, 2012 at 12:38 PM

Looks like the Google Server need some time to update the files in some way. Yesterday I had a lot of problems (the one you described, but also others like "no file found" and similar), but checking it again today... everything just worked.

You don't need the "Google Play Application License Verification" plugin! This is for additional licensing checks and has nothing to do with the expansion file plugin (GooglePlay OBB Downloader), which provide their own LVL.

One problem I had, was the english app name, which has to be equal in the GooglePlay Dev Console and in the app itself. I haven't found this in the documentation (or just skipped it). ;)

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 arnodekostair · Dec 17, 2012 at 06:04 PM

I had the same problem. In my case I was forgetting the CHECK_LICENSE permission in the manifest file. Even if the application is free (and so no need to check the license), it seems that this permission is needed to download the expansion file.

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

12 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

Related Questions

Android: Additional data download 0 Answers

Alternative to BuildStreamedSceneAssetBundle ? 0 Answers

Why download AssetBundle take so long? 0 Answers

How to download an animation from my server, and add it to my avatar on mobile device? 0 Answers

I wonder about AssetBundle Load 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