Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAPKReader.downloadExpansionIfAvailable() makes status bar disappear #117

Open
MajorBreakfast opened this issue Jan 9, 2018 · 13 comments
Open

Comments

@MajorBreakfast
Copy link

MajorBreakfast commented Jan 9, 2018

In order to make the splash screen show up I'm following the instructions in the README and use XAPKReader.downloadExpansionIfAvailable() to download the expansion files after the splash screen isn't visible anymore. Unfortunately calling this function has a side effect: The status bar slides up and is thus gone. As a workaround I've added StatusBar.show() to the callbacks of downloadExpansionIfAvailable(). Works perfectly, but it's a hack nonetheless :D

@MajorBreakfast
Copy link
Author

MajorBreakfast commented Jan 9, 2018

More details about my workaround: Calling StatusBar.show() synchronously in the callbacks of downloadExpansionIfAvailable() didn't work. I now call it repeatedly via this monstrosity: callRepeatedly(() => StatusBar.show(), 2000) Works, but it's not pretty

function callRepeatedly (fn, duration) {
  let id
  function tick () { fn(); id = setTimeout(tick, 1) }
  tick()
  setTimeout(() => { clearTimeout(id) }, duration)
}

@agamemnus
Copy link
Owner

agamemnus commented Jan 9, 2018 via email

@pedrojosecas
Copy link

Hi agamemnus,

I'm try to use your plugin with Cordova 8.0.0, but when build and run my project, crash complete.

Can you help me? I download from the branch cordova-6.5.0.

Thanks.

@agamemnus
Copy link
Owner

agamemnus commented Aug 6, 2018 via email

@agamemnus
Copy link
Owner

agamemnus commented Aug 6, 2018 via email

@pedrojosecas
Copy link

I found how some the issues but when make cordova run android appear this error and the app crash and close, you know why or give me some idea to solve:

08-06 13:52:08.017 1184-1184/com.mathshelf.mathshelf D/AndroidRuntime: Shutting down VM

--------- beginning of crash

08-06 13:52:08.018 1184-1184/com.mathshelf.mathshelf E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mathshelf.mathshelf, PID: 1184
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mathshelf.mathshelf/com.mathshelf.mathshelf.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2730)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1530)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:208)
at android.app.ActivityThread.main(ActivityThread.java:6304)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
at android.content.res.Resources.getInteger(Resources.java:1198)
at com.flyingsoftgames.xapkreader.XAPKReader.initialize(XAPKReader.java:71)
at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:57)
at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
at org.apache.cordova.PluginManager.init(PluginManager.java:86)
at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:117)
at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
at com.mathshelf.mathshelf.MainActivity.onCreate(MainActivity.java:50)
at android.app.Activity.performCreate(Activity.java:6704)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2683)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2795) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1530) 
at android.os.Handler.dispatchMessage(Handler.java:110) 
at android.os.Looper.loop(Looper.java:208) 
at android.app.ActivityThread.main(ActivityThread.java:6304) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924) 

@agamemnus
Copy link
Owner

This is weird. I'm not an expert on this. Can't tell. Can you try making a blank app and just add things in until it crashes?

@pedrojosecas
Copy link

I created a blank project and the same issue :(

when open the app crash and appear the same issue, I only download your project add the plugin to the blank project, make the configuration and then cordova run android, but crash :(

@agamemnus
Copy link
Owner

Can't tell anything from the bug report.. you can try to use a lower version or download things on the fly.

@pedrojosecas
Copy link

Hi Agamemnus,

I have a one question, is a dumb question, but I need ask you, I have the obb file in the folder but when I try to access like this:

< img src="content://com.companyname.myapp/src/image1.jpg">

I can't, in the obb file I have the sources in the folder src. And other question, the obb is unzip or only need access to the obb without unzip?

Thanks.

@agamemnus
Copy link
Owner

agamemnus commented Aug 9, 2018 via email

@pedrojosecas
Copy link

Thanks,

Yes the structure is same in my zip and try to load the source, but I can't access, say File not Found, the only way I can access is when I unzip the obb.

@agamemnus
Copy link
Owner

agamemnus commented Aug 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants