无法解析导入org.apache.cordova [英] The import org.apache.cordova cannot be resolved

查看:1892
本文介绍了无法解析导入org.apache.cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,在通过Phonegap的非包容性说明(甚至没有提到设置ANT,或者令人头疼的Ant和JDK)后,这根本不工作:

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");
    }
}

它提供5个错误引用的org.apache .cordova无法解决。我完全相信在这一点上做什么。请帮忙。这是在3个小时的试图得到的sdk工作,最终能够在eclipse中打开一个项目。按照他们的文档中的步骤,我留下了一个浪费了3个小时,除非我能明白这一点。

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.

推荐答案

我遇到了同样的问题。按照此处撰写的内容,我终于将其付诸实施。

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

phonegap github page 下载cordova后,您会看到cordova-2.2.0.jar和cordova-2.2.0.js在lib / android文件夹中。运行./create ...后,将cordova-2.2.0.jar复制到您的项目libs文件夹和cordova-2.2.0.js到您的www文件夹。然后将项目导入eclipse,它应该工作。

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.

我不得不去项目 - >属性 - > Android,并选择一个较新的SDK(我选择列表中的最新的一个),然后运行项目 - >清洁。

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.

这篇关于无法解析导入org.apache.cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆