King Goeks King Goeks - 3 months ago 53
Android Question

PhoneGap 1.8.1 - super.loadUrl("file:///android_asset/www/index.html") issue

I'd just download and use latest version of phonegap : v.1.8.1

as usual, I replace the

line with

When I test my "hello world" application, it will always force close. The app can't run properly. But if i change back the line into
, the app will run properly and there is no problem (for the application). The real problem is, the application not load the index.html because there is no

here is my code :


import android.os.Bundle;

import org.apache.cordova.DroidGap;

public class URFinderActivity extends DroidGap {

public void onCreate(Bundle savedInstanceState) {



Anyone can give me some advise about this?
Thank you :)


1) In your html file, have u put this line in <head>?

<script type="text/javascript" charset="utf-8" src="cordova-1.8.1.js"></script>

2) Add this line on top of your activity

import org.apache.cordova.*;

3) Have you copy cordova-1.8.1.jar from your Cordova download earlier into folder /libs

4) Have you configure project Build Path?

Right click on the /libs folder and go to Build Paths/ > Configure Build Path.... Then, in the Libraries tab, add cordova-1.8.1.jar to the project

5) Have you copy cordova.xml and plugins.xml file from your Cordova download earlier into folder /res/xml

This is your check list. Hope it help.