Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to open asset URL: file:///android_asset/www/

I get some error messages in Logcat when running my Android App, which was built using PhoneGap.

E/AndroidProtocolHandler(1475): Unable to open asset URL: file:///android_asset/www/css/mobile2.css
E/AndroidProtocolHandler(1475): Unable to open asset URL: file:///android_asset/www/scripts/custom.js
E/AndroidProtocolHandler(1475): Unable to open asset URL: file:///android_asset/www/scripts/customShare.js

Any ideas on how to fix this?

like image 200
Pascal Avatar asked Jan 20 '14 17:01

Pascal


4 Answers

Check the path (where you are trying to access it) to insure that it is correct. You could also check the permissions on the file to insure that you can read/ write to the file. Hope this helps.

like image 166
Joe Packer Avatar answered Nov 09 '22 11:11

Joe Packer


If this error persist after adding permission then check case of file names

as

file names are Case Sensitive in phonegap app

like image 40
mastermind Avatar answered Nov 09 '22 12:11

mastermind


In my case the problem was a underscore as a first letter in a folder name. I had:

file:///android_asset/html/_js

which I renamed to:

file:///android_asset/html/js

That fixed the problem.

like image 23
Marcus Avatar answered Nov 09 '22 11:11

Marcus


I have faced this issue and i have solved first i have placed my new.js file in asset-->www-->js-->new.js

after that i cut that file and placed in asset-->www-->new.js Now its working fine hope its help for you

like image 1
vbc Avatar answered Nov 09 '22 11:11

vbc