Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

For some reason, after going through Phonegap's non-inclusive instructions (it doesn't even mention setting up ANT, or the headaches with Ant and JDK), this doesn't work at all:

package com.HealthTrustSoftware.AndroidTemplate3;

import android.app.Activity;
import android.os.Bundle;
import org.apache.cordova.*;

public class AndroidTemplate3 extends DroidGap
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

It gives 5 errors referencing the fact that org.apache.cordova can't be resolved. I'm entirely sure what to do at this point. Please help. This is after 3 hours of trying to get the sdk working and finally being able to open a project within eclipse. After following the steps on their documentation, I am left with a wasted 3 hours unless I can figure this out.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
226 views
Welcome To Ask or Share your Answers For Others

1 Answer

I just ran into the same problem. Following what was written in here, I finally made it work.

After you download cordova from phonegap github page, you will find cordova-2.2.0.jar and cordova-2.2.0.js in lib/android folder. After running "./create ...", copy cordova-2.2.0.jar into your projects libs folder and cordova-2.2.0.js into your www folder. Then import the project into eclipse and it should work.

I had to go to "Project -> Properties -> Android" and select a newer SDK (I selected the latest one available on the list) and than run the "Project -> Clean" as well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...