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

查看:171
本文介绍了导入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工作,最后能够在日食中打开一个项目。在按照文件的步骤进行之后,我将被浪费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页面下载cordova后,您会发现cordova- lib / android文件夹中的2.2.0.jar和cordova-2.2.0.js。运行./create ...后,将cordova-2.2.0.jar复制到您的项目库文件夹和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天全站免登陆