Code Monkey home page Code Monkey logo

unityobbdownloader's People

Contributors

lacostej avatar over17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityobbdownloader's Issues

Is WRITE_EXTERNAL_STORAGE permission mandatory?

Google requires us to remove some seemingly unnecessary permissions from our app, including WRITE_EXTERNAL_STORAGE which is requested by your plugin.

Is this mandatory or the plugin should work without it?
Do we have to force installation to the internal storage if removed?

Thanks for the answers.

Customizing layout

Hi,I have been struggling these days to modify UnityOBBDownloader. I need a different layout that's why I need to change it. I exported it to android studio and changed it. But now I do not know how to put it back to unity. In drawables I have put my logo. I tried to put project folder to unity plugins but do not work. I am stuck here.
So the modified one has some icon images in drawables

NoSuchFieldError "BASE64_PUBLIC_KEY"

Hello,

I just installed the plugin, attached the example script provided to our splashcreen and filled the public key ("YOUR PUBLIC KEY HERE") with our public key. we created a split build with Unity 2018.4.24 and tried to test the downloader by installing only the apk.

The plugin properly display the fetch button but when we click it, we get the following error

07-16 16:52:54.347 31880 31902 E Unity : AndroidJavaException: java.lang.NoSuchFieldError: no "Ljava/lang/String;" field "BASE64_PUBLIC_KEY" in class "Lcom/unity3d/plugin/downloader/UnityDownloaderService;" or its superclasses 07-16 16:52:54.347 31880 31902 E Unity : java.lang.NoSuchFieldError: no "Ljava/lang/String;" field "BASE64_PUBLIC_KEY" in class "Lcom/unity3d/plugin/downloader/UnityDownloaderService;" or its superclasses 07-16 16:52:54.347 31880 31902 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 07-16 16:52:54.347 31880 31902 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0) 07-16 16:52:54.347 31880 31902 E Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:62) 07-16 16:52:54.347 31880 31902 E Unity : at android.os.MessageQueue.next(MessageQueue.java:405) 07-16 16:52:54.347 31880 31902 E Unity : at android.os.Looper.loop(Looper.java:174) 07-16 16:52:54.347 31880 31902 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32) 07-16 16:52:54.347 31880 31902 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 07-16 16:52:54.347 31880 31902 E Unity : at UnityEngine.AndroidJNISafe.GetStaticFieldID (System.IntPtr clazz, System.String name, System.String sig) [0x00000] in <00000000000000000000000000000000>:0 07-16 16:52:54.347 31880 31902 E Unity : at UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jcla

We are stuck here as we don't have any clue as why it doesn't work. Any idea what might cause the issue?

Strange Android 6.0 behaviour

Hi.

I'm observing some weird behaviour on devices running Android 6.0.
Our app is published on the Google Play Store. If we run it right after downloading and installing it from there Unity doesn't seem to find the obb file while the plugin returns a path. This cause our app to be stuck on the first loading screen.

I've searched around, and I'm not sure if this is related to the new permission system (#5). logcat doesn't show any error on that matter.
Strangely enough, after rebooting the device the problem is gone and the app runs without issue.

Is this really a permission issue?
We're using Unity 4.6.4f1 (a bug in later versions prevents us from upgrading)

Crash java.lang.IllegalStateException

Android 8.1
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 2018.2.20f1
Device model : Xiaomi Redmi 6

Device fingerprint: xiaomi/cereus/cereus:8.1.0/O11019/V10.2.3.0.OCGMIXM:user/release-keys
Caused by
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3257)
  at android.app.ActivityThread.-wrap17 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1722)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:176)
  at android.app.ActivityThread.main (ActivityThread.java:6656)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:873)
 Caused by: java.lang.IllegalStateException:
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1532)
  at android.app.ContextImpl.startService (ContextImpl.java:1488)
  at android.content.ContextWrapper.startService (ContextWrapper.java:660)
  at android.content.ContextWrapper.startService (ContextWrapper.java:660)
  at com.unity3d.plugin.downloader.c.j.a (Unknown Source:108)
  at com.unity3d.plugin.downloader.c.j.a (Unknown Source:8)
  at com.unity3d.plugin.downloader.UnityAlarmReceiver.onReceive (Unknown Source:2)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3250)

Support OBBs with different version codes to the app

As per https://developer.android.com/google/play/expansion-files#Filename, it is possible to have a case where the OBB and app version codes are different to one another:

<expansion-version>

This is an integer that matches the version code of the APK with which the expansion is first associated (it matches the app's android:versionCode value).

"First" is emphasized because although the Play Console allows you to re-use an uploaded expansion file with a new APK, the expansion file's name does not change—it retains the version applied to it when you first uploaded the file.

When dealing with large expansion files, it is likely that app developers will want to reuse them, in order to avoid forcing unnecessary re-downloads of the same expansion content when an app update is published.

The underlying expansion file downloader library around which this plugin is based already supports this, as it queries the expected expansion file name(s) and checks for their existence on the file system in order to determine whether a download is required or not:

DownloadInfo[] infos = db.getDownloads();
if (null != infos) {
for (DownloadInfo info : infos) {
if (!Helpers.doesFileExist(context, info.mFileName, info.mTotalBytes, true)) {
status = DOWNLOAD_REQUIRED;
db.updateStatus(-1);
break;
}
}
}

However, the C# implementation makes the assumption that the expansion files will have the same version number as the app:

private static void PopulateOBBProperties()
{
using (var unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
var currentActivity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
m_ObbPackage = currentActivity.Call<string>("getPackageName");
var packageInfo = currentActivity.Call<AndroidJavaObject>("getPackageManager").Call<AndroidJavaObject>("getPackageInfo", m_ObbPackage, 0);
m_ObbVersion = packageInfo.Get<int>("versionCode");
}

If the Java plugin were able to provide a means for the C# script to call a native method that performs the same check as DownloaderService, then expected expansion file names could be returned and their existence checked with File.Exists.

Currently, you could always call IGooglePlayObbDownloader.FetchOBB, rather than first checking if GetMainOBBPath returns null (as in DownloadObbExample) and allow the native plugin to decide if a download is required, but then there's no easy way to check if/when the native plugin has finished downloading, because waiting for GetMainPath to not be null to indicate completion will result in an infinite wait, due to the version codes mismatch.

www error Request aborted

Hi,

I use the DownloadObbExample.cs in my game and in that debug I can see... "waiting mainPath", "downloading" and the finally "wwww error Request aborted". After this the game gets stuck and I can't release the build. In my android device OBB folder I can see that the OBB file has been successfully downloaded, but it won't work.

It worked before but after I updated to Unity 2017.2.0f3 something broke.

Replacing BASE64_PUBLIC_KEY is messy

"Open GooglePlayDownloader.cs and replace the BASE64_PUBLIC_KEY"

This means anytime someone updates the plugin, it will overwrite their changes and break the project.

It would be better if GooglePlayDownloader has a .SetKey() function that you have to call before then calling Init(), so the code in the constructor now goes into Init(), but will only run if you've set the key value first, otherwise will log an error.

Would be much nicer :)

Create aar version ?

Is it possible to create an aar version of this plugin ?
Cause it's simplier to manage them and it seems to be the new standard with a lot of plugins.

Android 6.0 compatibility

See http://forum.unity3d.com/threads/www-loadfromcacheordownload-on-obb-fails-with-npe-in-java-layer.364197/ and http://stackoverflow.com/questions/33030933/android-6-0-open-failed-eacces-permission-denied

Main issue is that the OBBDownloader reuses the Google Play APK Expansion rev 3 which isn't Android 6.0 permission compatible.

Someone should take contact with Google to see if they are working on an updated version. See also https://code.google.com/p/android/issues/detail?id=183844

android update deprecated

In new versions of android sdk/android studio there's no more "android update". Also ant is no longer bundled with the sdk tools. Any change of getting a update version for the latest unity/android setups? If you're worried about maintaining compatibility for older users, I recommend tagging the current master as version 1.0, then releasing a 2.0 for newer versions. Just make it clear in the README what version is for who.

obb download failed because the resources could not be found

i use this plugin for long time, it used to be fine, but recently, it does not work anymore, always show this notice: obb download failed because the resources could not be found. the only things changed maybe my unity version and beta to official on google.

Failed to transform artifact in Unity 2020.3.7f1

The following error appears during project build.

 FAILURE: Build failed with an exception.
 * What went wrong:
 Execution failed for task ':unityLibrary:javaPreCompileRelease'.
 > Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'.
    > Failed to transform artifact 'unityOBBDownloader.aar (:unityOBBDownloader:)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
       > Execution failed for AarToClassTransform: C:\Users\PC\.gradle\caches\transforms-2\files-2.1\7d4fbbc0dd844aed72a5d0126e59d525\jetified-unityOBBDownloader.aar.
          > entry

Removing gradle caches does not eliminate this error.

Downloading failed on Sony Xperia Z3 compact (Androd 4.4.4)

Error log:

11-30 03:54:30.975 1306-1317/? W/Binder: Caught a RuntimeException from the binder stub implementation.
11-30 03:54:30.975 1306-1317/? W/Binder: java.lang.NullPointerException
11-30 03:54:30.975 1306-1317/? W/Binder: at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
11-30 03:54:30.975 1306-1317/? W/Binder: at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
11-30 03:54:30.975 1306-1317/? W/Binder: at android.os.Binder.execTransact(Binder.java:404)
11-30 03:54:30.975 1306-1317/? W/Binder: at dalvik.system.NativeStart.run(Native Method)

download not loading

Hello,
I have brought the downloader into my project. when I run it on android it downloads the obb file and then does not load to the second scene it hangs not loading anything.
I do some checks after the file is downloaded to make sure it is there and it say it is but it docent move to the next scene. Any help would be great or pointing into the right direction would be great

Black background with Unity 2018.4.23f1

The android activity has a black background when using a fresh 2018.4.23f1 project, you can see the progress bar and pause download button, but nothing else is visible, I will upload a screenshot.

Screenshot_20200810-135829

Null Reference Error

Hi I'm trying to use OBB with Unity 2019.3, I keep receiving a object null reference error in the public key section specified on the DownloadOBBExample. It happens when I attached to the main camera or game object....

m_obbDownloader.PublicKey = " "; // YOUR PUBLIC KEY HERE

I've tried creating a separate public string and then assigning it...

public string mykey;

(I assigned my actual key using the void Awake() method to load before the Start method)

m_obbDownloader.PublicKey = myKey;

I'm not sure why its causing this error....

Crash on Android 9.0

hi,I have a problem. My English is not very good. google play Obb download error~
java.lang.IllegalArgumentException:
at com.unity3d.plugin.downloader.d.d.a (Unknown Source:44)
at com.unity3d.plugin.downloader.d.d. (Unknown Source:21)
at com.unity3d.plugin.downloader.c.m.run (Unknown Source:63)
at android.os.Handler.handleCallback (Handler.java:907)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:216)
at android.app.ActivityThread.main (ActivityThread.java:7625)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
Caused by: com.unity3d.plugin.downloader.e.b:
at com.unity3d.plugin.downloader.e.a.a (Unknown Source:175)
at com.unity3d.plugin.downloader.d.d.a (Unknown Source)

remove self

when my game enter background, then i click from service bar, or from home icon, the UnityDownloaderActivity finish self, but the service bar is exist, and the obb not finished.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.