Closed roedoejet closed 7 years ago
I assumed this has something to do with the whitelist plugin, but I followed the instruction:
<meta http-equiv="Content-Security-Policy" content="* * 'self' default-src 'unsafe-inline' 'unsafe-eval' http://* https://* data: cdvfile://* content://*;">
to my index.html<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.firstvoices.lilwat_fphlcc" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Lilwa_</name>
<description>
An Ucwalmicwts/English Dictionary
</description>
<author email="" href="">
Aidan Pine
</author>
<content src="index.html"/>
<allow-navigation href="*://*/*"/>
<allow-intent href="*" />
<access origin="*" />
<access origin="content:///*" />
<access origin="cdvfile:///*" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="xwalkVersion" value="22+"/>
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect"/>
<preference name="xwalkMode" value="embedded"/>
<preference name="xwalkMultipleApk" value="true"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<platform name="android">
<icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
<icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
<icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
<icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
<icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
<icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
<splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
<splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
<splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
<splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
<splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
<splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
<splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
<splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
<splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
<splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
</platform>
<platform name="ios">
<icon src="resources\ios\icon\icon.png" width="57" height="57"/>
<icon src="resources\ios\icon\icon@2x.png" width="114" height="114"/>
<icon src="resources\ios\icon\icon-40.png" width="40" height="40"/>
<icon src="resources\ios\icon\icon-40@2x.png" width="80" height="80"/>
<icon src="resources\ios\icon\icon-40@3x.png" width="120" height="120"/>
<icon src="resources\ios\icon\icon-50.png" width="50" height="50"/>
<icon src="resources\ios\icon\icon-50@2x.png" width="100" height="100"/>
<icon src="resources\ios\icon\icon-60.png" width="60" height="60"/>
<icon src="resources\ios\icon\icon-60@2x.png" width="120" height="120"/>
<icon src="resources\ios\icon\icon-60@3x.png" width="180" height="180"/>
<icon src="resources\ios\icon\icon-72.png" width="72" height="72"/>
<icon src="resources\ios\icon\icon-72@2x.png" width="144" height="144"/>
<icon src="resources\ios\icon\icon-76.png" width="76" height="76"/>
<icon src="resources\ios\icon\icon-76@2x.png" width="152" height="152"/>
<icon src="resources\ios\icon\icon-83.5@2x.png" width="167" height="167"/>
<icon src="resources\ios\icon\icon-small.png" width="29" height="29"/>
<icon src="resources\ios\icon\icon-small@2x.png" width="58" height="58"/>
<icon src="resources\ios\icon\icon-small@3x.png" width="87" height="87"/>
<splash src="resources\ios\splash\Default-568h@2x~iphone.png" width="640" height="1136"/>
<splash src="resources\ios\splash\Default-667h.png" width="750" height="1334"/>
<splash src="resources\ios\splash\Default-736h.png" width="1242" height="2208"/>
<splash src="resources\ios\splash\Default-Landscape-736h.png" width="2208" height="1242"/>
<splash src="resources\ios\splash\Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
<splash src="resources\ios\splash\Default-Landscape@~ipadpro.png" width="2732" height="2048"/>
<splash src="resources\ios\splash\Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="resources\ios\splash\Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="resources\ios\splash\Default-Portrait@~ipadpro.png" width="2048" height="2732"/>
<splash src="resources\ios\splash\Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="resources\ios\splash\Default@2x~iphone.png" width="640" height="960"/>
<splash src="resources\ios\splash\Default~iphone.png" width="320" height="480"/>
</platform>
<icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
</widget>
Do you have the Cordova Media plugin installed?
No I don't, am currently calling my audio with HTMLAudioElement:
srcURL = "content://com.firstvoices.lilwat_fphlcc/audio/" + src
var audio = new Audio(srcURL);
audio.play()
Try removing the whitelist plugin entirely and modifying the java file to ignore it.. let me find the code..
(Might be a few minutes, kind of getting pulled in all directions right now)
Also, try seeing if you can get any other format to work to rule out other issues... PNGs? Text files?
Tried with 'jpg' and same error:
content://com.firstvoices.lilwat_fphlcc/audio/test.jpg Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
Maybe the underscore is doing it? I really don't know. Try text files also.
Same error with .txt ...
Try removing the underscore...
Unfortunately the same thing: content://com.firstvoices.lilwatfphlcc/audio/test.jpg Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
Change out this file:
https://github.com/agamemnus/cordova-plugin-whitelist/blob/master/src/android/WhitelistPlugin.java
See what happens if you have shouldAllowNavigation
, shouldAllowRequest
, and shouldOpenExternalUrl
to simply return true
.
Same error.
And text files don't work either?
Nope.
content://com.firstvoices.lilwatfphlcc/audio/test.txt:1 GET content://com.firstvoices.lilwatfphlcc/audio/test.txt net::ERR_UNKNOWN_URL_SCHEME
I just saw in a folder called "test-project-instructions-and-test-obb" in the plugin there's a step that's not included on the repo markdown. It says to add: android.library.reference.2=../../plugins/com.flyingsoftgames.xapkreader/android-sdk/extras/google/play_apk_expansion/downloader_library
to /platforms/android/project.properties
But I already have a value for that (see below), should I change it or is the above for testing with Google Play or another version?
target=android-25
android.library.reference.1=CordovaLib
cordova.system.library.1=com.google.android.gms:play-services-base:+
android.library.reference.2=com.flyingsoftgames.xapkreader/lilwatfphlcc-downloader_library
android.library.reference.3=com.flyingsoftgames.xapkreader/lilwatfphlcc-library
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/lilwatfphlcc-xwalk.gradle
This is for an older version. That should be removed.
Is your obb uncompressed?
Yes, I used 7zip and set the compression level to "store"
There must be something simple we are missing. Can you create a small sample project based on your settings that I can run?
Sure. You can clone the sandbox I have for the app here: https://github.com/roedoejet/lilwat-test.git
I'm calling the audio in controllers.js and have the img and text in www/templates/search.html
Or do you want something with fewer bells and whistles? This way you have what I have.
I've got to run out for a couple hours soon to another job but I'll be back in a few hours. I really appreciate you looking at this!
I assume you are testing this with Android... are you using the latest Android platform version, or which version? Your code doesn't say.
testing on a device running 5.1
Also -- the obb file -- it's not there.
Oops. Sorry about that. just added it but with most of the audio taken out. There are three files, audio/183Sounds20060420153235640knife_lil.mp3, audio/test.jpg, audio/test.txt
Thx.
Downloaded it and installed latest Android platform, but didn't test.... please remind me tomorrow...
Ok great. thanks, I'll do that.
Any update on this? ... a friendly reminder :)
Checking now.
Maven? Might this be an issue?
No, that isn't it. Still checking a few different things.
Here is the problem: you do not have the File plugin installed, and for some reason your whitelist plugin is some random old dev version.
Huh, I didn't know I needed the File plugin, but that makes sense. The whitelist plugin I added was the one here which is listed on the readme, is that not right? https://github.com/agamemnus/cordova-plugin-whitelist
Oh, weird. I had no idea it was a dev version... but it IS old. :P
lol yes, so is it still required or does the newer version/main repo of cordova-plugin-whitelist work?
I did do a few different things.
If that still doesn't work, try instalilng a clean whitelist plugin as well, and try this for a meta tag:
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' http://* https://* 'unsafe-eval';">
No, it's not required if you have the various tags to change the security policy, etc.
You could also just delete the plugin...
Ok, I got the net::ERR_UNKNOWN_URL_SCHEME error to go away by removing the whitelist plugin altogether and by using the updated meta tag above. Now I'm getting 404's :( did the content actually come through for you? Thanks so much again for looking into this. I'll keep looking into it.
It did. You added the File plugin?
Update your code on github and I'll look at it again. I did do a number of things which might have had an effect...
Yep. I added the File plugin. It looks like the cordova-compat plugin got installed as a dependency or something. I've updated the repo with my changes
Ok, give me a bit and I will try again.
thanks!
It'll be tomorrow. I'm stuck on a bug (?) in another library and very tired. Sry.
no problem. you could also make a pull request to the repo with your local copy and I can try and see what other changes you made. g'night!
any luck? I'm heading out to work but will be back this afternoon/evening to have another look. Had me stumped yesterday.
I was busy all day yesterday. I am looking now, that I am wrapping up my bug work for the other project.
OK, no problem. Again, I really appreciate you looking into this. Be back in a few hours.
It's not working. I keep having issues with Error: Unexpected end of JSON input
when I try to add the android platform, etc.
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!