agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

Android 7 Error? #105

Closed jabawack81 closed 6 years ago

jabawack81 commented 6 years ago

I get a strange error that seems to be related to a Android 7:

java.lang.NullPointerException: Attempt to get length of null array
    at com.flyingsoftgames.xapkreader.XAPKExpansionSupport.listFiles(XAPKExpansionSupport.java:63)
    at com.flyingsoftgames.xapkreader.XAPKExpansionSupport.getAPKExpansionFiles(XAPKExpansionSupport.java:34)
    at com.flyingsoftgames.xapkreader.XAPKExpansionSupport.getAPKExpansionZipFile(XAPKExpansionSupport.java:82)
    at com.flyingsoftgames.xapkreader.XAPKProvider.initIfNecessary(XAPKProvider.java:112)
    at com.flyingsoftgames.xapkreader.XAPKProvider.call(XAPKProvider.java:97)
    at android.content.ContentProvider$Transport.call(ContentProvider.java:404)
    at android.content.ContentResolver.call(ContentResolver.java:1449)
    at com.flyingsoftgames.xapkreader.XAPKDownloaderActivity.onDownloadStateChanged(XAPKDownloaderActivity.java:234)
    at com.google.android.vending.expansion.downloader.DownloaderClientMarshaller$Stub$1.handleMessage(DownloaderClientMarshaller.java:135)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6776)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)

I'm personally testing the app on various phone with Android 6 (one plus one and HTC One m7) and everything looks normal but I got some errors on the play console and the only difference I can fin is the android version ( Samsung Galaxy Tab A 10.1 (gtaxllte) poking around I found out that in the plugin I've found out that you're using the version 3 of the "Client library for the Google Play APK Expansion files." and google has released the version 4.

agamemnus commented 6 years ago

Ok. I didn't realize. I'll update it asap.

agamemnus commented 6 years ago

Actually, can you try it with 4 and see how it goes?

jabawack81 commented 6 years ago

OK no problem. Mine was simply a shot in the dark trying to be useful but I'll try and report back.

jg33 commented 6 years ago

Hi– I'm experiencing the same error, but I'm not sure if it's specifically Android 7. I've got it running and downloading just fine on a Moto G4 on Android 7, but not a Samsung S7 (also on 7). I'd love any advice or clues you've discovered while troubleshooting. Thanks!

: jesse

jabawack81 commented 6 years ago

I gave for granted that the problem was on Android 7 because I tested my app on various device with Android 6 and it failed only on Android 7 but with your information I start to believe that the problem could be more relative to Android 7 on Samsung Device, I have absolutely no idea how this could be.

agamemnus commented 6 years ago

Could be related to certain defaults on Samsung devices?

jg33 commented 6 years ago

That's it- Before launching the app, I have to enable storage permissions on the Samsung. Just have to do that programatically- maybe with this: https://www.npmjs.com/package/cordova-plugin-android-permissions. Thanks for your help!

agamemnus commented 6 years ago

Oh yes. We had some problems with that before but could not really solve it.

agamemnus commented 6 years ago

Please let me know if that solves it.

jg33 commented 6 years ago

Yep! Seems to break things on Motorola, but I bet it's fixable.

agamemnus commented 6 years ago

Ugh. Why would it break things on Motorola?

jg33 commented 6 years ago

Not sure. Maybe just a timing/ order of operations thing. I'll try to figure it out. Thanks!

On Jul 28, 2017, 8:57 AM -0700, agamemnus notifications@github.com, wrote:

Ugh. Why would it break things on Motorola? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jabawack81 commented 6 years ago

@jg33 thanks that fixed for me.

agamemnus commented 6 years ago

Great. Thanks for confirmation. I won't close this yet, though, as I'd like to see if I can do anything to the code/documentation to fix this in the same way.

chipbell4 commented 6 years ago

@jabawack81 can you take a look now on Android 7 again? We were having the same issue on our side with Android 7, but merging #113 has resolved it on our end.

jabawack81 commented 6 years ago

@chipbell4 Sorry for the delayed response, this fixed the problem for me.