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
0
Question by GekidoRising · Jan 23, 2015 at 07:03 AM · androidapk expansion filesexpansion

GooglePlayDownloader crashes on FetchOBB()

I'm currently working on splitting our application so that we can surpass the 50 MB limit, but I'm running into issues actually testing whether or not the code for downloading the OBB works. The issue occurs like so:

  • Open up the app, it detects that the OBB is not present and presents a button to fetch the obb

  • Pushing the button crashes the game with "Unfortunately, __ has stopped"

  • Going back to the home screen shows a notification that says "Looking for resources to download"

My symptoms are exactly the same as http://answers.unity3d.com/questions/779103/crash-on-android-when-trying-to-download-obb.html however their issue was resolved due to an issue with their public key. I've pretty much triple checked mine and it seems to be completely fine. I have it assigned to a string which is then assigned to the BASE64_PUBLIC_KEY. The string itself has no spaces and is just a huge string of characters which is identical to what google gave me for that specific app.

I do have some other things to note about my error though:

  • Downloading the game from the store works because it downloads the obb at the same time. I haven't actually tested downloading only the apk and then downloading the obb from code because I don't know a way to only get the apk from the store.

  • I've been testing this by uploading the apk directly to my phone and then when the game is live on the store, testing the FetchOBB() method. I don't know downloading the apk from the google store is required for the system to know where to get the obb

  • The actual error I'm running into, according to logcat, is:

    E/AndroidRuntime(27999): Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.licensing.ILicensingService } E/AndroidRuntime(27999): at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674) E/AndroidRuntime(27999): at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1773) E/AndroidRuntime(27999): at android.app.ContextImpl.bindService(ContextImpl.java:1751) E/AndroidRuntime(27999): at android.content.ContextWrapper.bindService(ContextWrapper.java:538) E/AndroidRuntime(27999): at com.unity3d.plugin.downloader.c.j.a(Unknown Source) E/AndroidRuntime(27999): at com.unity3d.plugin.downloader.b.s.run(Unknown Source) E/AndroidRuntime(27999): at android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime(27999): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime(27999): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(27999): at android.app.ActivityThread.main(ActivityThread.java:5221) E/AndroidRuntime(27999): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(27999): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(27999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) E/AndroidRuntime(27999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

And lastly, the code I'm actually running

 using UnityEngine;
 using System.Collections;
 
 public class ExpansionDownloader : MonoBehaviour
 {
     void OnGUI()
     {
         if (!GooglePlayDownloader.RunningOnAndroid())
         {
             GUI.Label(new Rect(10, 10, Screen.width-10, 20), "Use GooglePlayDownloader only on Android device!");
             return;
         }
         string expPath = GooglePlayDownloader.GetExpansionFilePath();
         if (expPath == null)
         {
             GUI.Label(new Rect(10, 10, Screen.width-10, 20), "External storage is not available!");
         }
         else
         {
             string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
             string patchPath = GooglePlayDownloader.GetPatchOBBPath(expPath);
             GUI.Label(new Rect(10, 10, Screen.width-10, 20), "Main = ..." + ( mainPath == null ? " NOT AVAILABLE" : mainPath.Substring(expPath.Length)));
             GUI.Label(new Rect(10, 25, Screen.width-10, 20), "Patch = ..." + (patchPath == null ? " NOT AVAILABLE" : patchPath.Substring(expPath.Length)));
             if (mainPath == null && patchPath == null)
             {
                 if (GUI.Button(new Rect(10, 100, 400, 400), "Fetch OBBs"))
                     GooglePlayDownloader.FetchOBB();
             }
             else
             {
                 Application.LoadLevel("CutScene");
             }
         }
     }
 
 }
Comment
Add comment
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

2 Replies

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

Answer by GekidoRising · Jan 23, 2015 at 06:16 PM

EDIT: The following bug is now fixed for Android 5+

Upon testing this on another phone, I've learned that this bug only seems to be occurring on my phone specifically.

http://reign-studios.net/forums/viewtopic.php?f=7&t=246

In the above link for a different plugin, people are reporting the exact same error being specific to Android 5.0.1 on the Nexus 5. This renders the bug rather irrelevant because every time I downloaded the app from the store, the obb was always downloaded with it.

I'm not 100% sure that will be the case for every Nexus 5 out there but as far as I can tell, I've done everything I can on my end, so here's to hoping that it gets fixed on whatever side it's broken.

Comment
Add comment · Show 1 · 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 Yury-Habets ♦♦ · Jan 26, 2015 at 11:03 AM 0
Share

This issue seems to be actual for all Android 5.0+.

Here is the fixed plugin and code: https://github.com/Unity-Technologies/UnityOBBDownloader

You may just download the updated jar file in bin/ directory and replace it in your Unity project.

avatar image
0

Answer by Yury-Habets · Jan 23, 2015 at 10:40 AM

Please take a look at these:

http://forum.unity3d.com/threads/google-play-obb-downloader-plugin-crashes-on-lollipop.290861/

https://code.google.com/p/android-developer-preview/issues/detail?id=1674

In the meanwhile, I will take a look and will try to fix it in the official package.

Comment
Add comment · Show 3 · 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 GekidoRising · Jan 23, 2015 at 02:09 PM 0
Share

I took a look at our current API and it turns out that we actually had the target sdk set to API 9 and that API 21 isn't even an option!

Regardless, I decided that I'd set the target SD$$anonymous$$ to API 18 (the highest one we could target) and I added

 intent.Call<AndroidJavaObject>("setPackage", "com.android.vending");

to the FetchOBB() method directly above the "addFlags" call. Unfortunately, I still seem to be getting the same crash as before with no change in the error. I'm currently in the midst of letting the play store make the alpha build downloadable in the hopes that the crash was happening because the obb wasn't present in the store yet.

avatar image GekidoRising · Jan 23, 2015 at 06:50 PM 0
Share

I don't know if me answering my own question sends you an email so I thought I'd just send a quick heads up to say that I figured it out but for reasons mentioned in my answer, it still needs looking into either on Unity's or Android's end.

avatar image Yury-Habets ♦♦ · Jan 26, 2015 at 06:19 AM 0
Share

@GekidoRising thank you!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Does Resources.Load() not work with Android Split Application 2 Answers

PlayFullScreenMovie doesn't work with Android Expansion APK? 0 Answers

Android Google Play OBB Downloader 1 Answer

OBB expansion files problem 1 Answer

Expansion/Database help 2 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