agamemnus / cordova-plugin-xapkreader

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

net::ERR_UNKNOWN_URL_SCHEME #98

Closed roedoejet closed 7 years ago

roedoejet commented 7 years ago

Hi there,

Looking for some help debugging an issue with the plugin. I've added the plugin to my project as described for cordova 6.5 but the content:// URL scheme is still not recognized. My obb is a stored zip with one folder called "audio".

content://com.firstvoices.lilwat_fphlcc/audio/183Sounds20060713173801859seal_lil.mp3:1 GET content://com.firstvoices.lilwat_fphlcc/audio/183Sounds20060713173801859seal_lil.mp3 net::ERR_UNKNOWN_URL_SCHEME

Thank you!

roedoejet commented 7 years ago

Looks like for some reason my fetch.json was invalid json. I just pushed a version that is working. Sorry about that.

roedoejet commented 7 years ago

Yeah. So same thing with the version that's on that repo; I get 404s without Cordova Whitelist, and unknown url scheme errors with Cordova Whitelist.

agamemnus commented 7 years ago

Checking in a few minutes...

agamemnus commented 7 years ago

Fell asleep.

agamemnus commented 7 years ago

Unfortunately, something got borked yesterday. I don't know what happened. Any ideas?

C:\test>cordova run android
ANDROID_HOME=C:\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_20
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
agamemnus commented 7 years ago

I ended up manually installing Gradle 3.5. I don't think that is right...

agamemnus commented 7 years ago

I noticed that putting the obb in the external card does not work. That is a problem... this used to work. Probably one of the newer updates to the plugin broke the pathing. Can you check if this fixes the issue, before doing anything else?

If you are using an external card already and it works, try: cordova platform add android It installed 6.2.3. cordova run android Compiled the app. Took a while. Lots of x86 stuff. Not sure why. It worked.

roedoejet commented 7 years ago

might be an issue with the version of Android Studio https://github.com/driftyco/ionic/issues/10604

roedoejet commented 7 years ago

I tried putting the obb on both my SD and phone storage, same thing. With whitelist, unknown url schemes, and without whitelist I get 404s

agamemnus commented 7 years ago

I am not using Android Studio. Or Ionic, for that matter...

roedoejet commented 7 years ago

Hm. ok, that might be part of the

Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio

You say you got it working though?

agamemnus commented 7 years ago

Yes. Installed Gradle 3.5 by itself.

roedoejet commented 7 years ago

and you didn't get any of the errors I'm getting with your build?

agamemnus commented 7 years ago

As of today, I only got errors like that when the file was missing in the internal memory drive.

agamemnus commented 7 years ago

I also added back the whitelist plugin. I think.

roedoejet commented 7 years ago

because you said you were getting a lot of x86 stuff, I removed:

cdvBuildMultipleApks=false from build-extras.gradle

and now I'm getting this error:

Not allowed to load local resource: content://com.firstvoices.lilwatfphlcc/audio/test.txt

and unknown url scheme errors on both the jpg and txt as well

roedoejet commented 7 years ago

can you PR your local copy? I can look at that.

agamemnus commented 7 years ago

Seems like a lot of work to upload it. Try creating an Android build and let me try from there. Are you trying with "cordova run android"?

On May 7, 2017 1:26 PM, "Aidan Pine" notifications@github.com wrote:

can you PR your local copy? I can look at that.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/98#issuecomment-299721073, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWPIcQNaGXaQZ48c5PXX2vhaEki6pks5r3f7BgaJpZM4NPzpv .

roedoejet commented 7 years ago

You want me to upload an android build? I've been using ionic run android but just tried with cordova run android and the same issue came up.

roedoejet commented 7 years ago

just apk or add my whole platform/android folder to the repo?

agamemnus commented 7 years ago

Actually. Let's try the apk. That's easier.

On May 7, 2017 1:36 PM, "Aidan Pine" notifications@github.com wrote:

just apk or add my whole platform/android folder to the repo?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/98#issuecomment-299721715, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWOQRQew9YQ5e68D6cgnompXTj9fyks5r3gEsgaJpZM4NPzpv .

roedoejet commented 7 years ago

K I can build a few, with whitelist and without etc.. would that be helpful?

agamemnus commented 7 years ago

Idk. Ok.

On May 7, 2017 1:43 PM, "Aidan Pine" notifications@github.com wrote:

K I can build a few, with whitelist and without etc.. would that be helpful?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/98#issuecomment-299722095, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWLkbKSO9scoPbuiI9ioCKIHzBP-0ks5r3gLBgaJpZM4NPzpv .

agamemnus commented 7 years ago

Lmk when ready.

On May 7, 2017 1:54 PM, "Michael Romanovsky" agamemnus@gmail.com wrote:

Idk. Ok.

On May 7, 2017 1:43 PM, "Aidan Pine" notifications@github.com wrote:

K I can build a few, with whitelist and without etc.. would that be helpful?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/98#issuecomment-299722095, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWLkbKSO9scoPbuiI9ioCKIHzBP-0ks5r3gLBgaJpZM4NPzpv .

roedoejet commented 7 years ago

made 3 different builds, uploading to repo's root directory in folder called "builds". I'll post when finished uploading.

roedoejet commented 7 years ago

forgot about githubs 50mb limit. Here's a link you can use https://drive.google.com/open?id=0BwW7wFq3J1ieaHBXNC16bGhUV0k

agamemnus commented 7 years ago

The first one works.

Where are you putting your obb file? Phone/Android/obb/com.firstvoices.lilwatfphlcc/?

roedoejet commented 7 years ago

yep Phone/Android/obb/com.firstvoices.lilwatfphlcc/main.1.com.firstvoices.lilwatfphlcc.obb

agamemnus commented 7 years ago

Android version?

agamemnus commented 7 years ago

Do you get a permissions request when you first install the apk?

roedoejet commented 7 years ago

Android 5.1 running on a device. Yes I get the list of device access permissions in the package installer before clicking 'install'. Nothing explicitly asking for permission.

agamemnus commented 7 years ago

Can you send me a screenshot? It might be a version issue. I guess one of the last few updates broke it. :| I have 6.0.1.

roedoejet commented 7 years ago

image

roedoejet commented 7 years ago

that sufficient?

agamemnus commented 7 years ago

I wanted to see your screenshot of the permissions screen. I think we are talking about different things.

roedoejet commented 7 years ago

do you mean this? screenshot_2017-05-07-13-10-46 screenshot_2017-05-07-13-10-41

agamemnus commented 7 years ago

Definitely not the same permission screen. Let me show you mine.

agamemnus commented 7 years ago

Not sure that attached email worked. Anyway, yeah. I think it is down to the last few updates I made to the code over the last month (PRs from others). Try seeing if you can test it in 6+?

roedoejet commented 7 years ago

your attached email didn't come through. I don't have any devices with 6+, working on emulating right now, will post results.

roedoejet commented 7 years ago

I a proper permissions modal on it this time. But am still trying to get the .obb to the right place in Genymotion. Without the obb there, I'm still getting the unknown url scheme error

screenshot-2017-05-07_15 23 55 607

agamemnus commented 7 years ago

I encountered the same problem with Genymotion a while ago. I didn't know if it was fixable.

Maybe you can just try the version from like 2 months ago.

roedoejet commented 7 years ago

Isn't that permission modal only supposed to come up in Android 6 anyways? seems to say that here anyways: https://github.com/agamemnus/cordova-plugin-xapkreader/commit/a2cc601fd58867e52e056321dc0bca2bd964e769

agamemnus commented 7 years ago

Yeah. But, uh, that's not the "reason" it might not be working... long story. Just try an older version from the history..... (sorry, it is a mess!)

roedoejet commented 7 years ago

is there a specific commit you can recommend?

agamemnus commented 7 years ago

Try https://github.com/agamemnus/cordova-plugin-xapkreader/tree/3ec6ec902e35c01343cfc1cf0b79b936e5c09ead.

roedoejet commented 7 years ago

Ok, rebuilt with 3ec6ec902e35c01343cfc1cf0b79b936e5c09ead and same thing. 404s without whitelist, unknown url scheme without whitelist :(

agamemnus commented 7 years ago

Well, it is clearly an issue with the Android version or some configuration you have... of course the issue ultimately originates in the code, but it will be difficult to debug. Maybe console logging the actual path that the code calculates (with Java) can yield clues.

marcelo-sc commented 7 years ago

Could you solve this problem @roedoejet

roedoejet commented 7 years ago

@marcelo-sc unfortunately I couldn't. Admittedly, I only worked on it for about another half day before giving up. I made some compromises to the app though and could basically do what I wanted to do with cordova-plugin-file and cordova-plugin-file-transfer so I haven't had to try getting this to work again.

agamemnus commented 7 years ago

@marcelo-sc: What Android version were you on when you had this issue?