我已按照http://cordova.apache.org/docs/en/edge/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android上的说明进行操作,根据指南,我有一个"红色x"我的项目; 我按照指示清理构建但没有改变.
我收到以下5个错误
The import org.apache.cordova cannot be resolved Bathurst.java /Bathurst/src/com/aligma/bathurst line 23 Java Problem
DroidGap cannot be resolved to a type Bathurst.java /Bathurst/src/com/aligma/bathurst line 25 Java Problem
The method onCreate(Bundle) of type Bathurst must override or implement a supertype method Bathurst.java /Bathurst/src/com/aligma/bathurst line 28 Java Problem
DroidGap cannot be resolved to a type Bathurst.java /Bathurst/src/com/aligma/bathurst line 30 Java Problem
Config cannot be resolved Bathurst.java /Bathurst/src/com/aligma/bathurst line 32 Java Problem
Run Code Online (Sandbox Code Playgroud)
生成的文件包含上述问题
package com.aligma.bathurst;
import android.os.Bundle;
import org.apache.cordova.*;
public class Bathurst extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html")
}
}
Run Code Online (Sandbox Code Playgroud)
所以这就是我现在被困住的地方.
与此同时,我设法建立了一个cordova-2.7.0.jar.在项目属性> Java Build Path> Libraries中,我使用"Add External JARs ..."按钮添加了它.所有构建错误都消失了,但我无法运行该应用程序.
寻找关于我接下来可以做什么的想法.
在项目属性> Java Build Path> Libraries中,我使用"Add External JARs ..."按钮添加了它.所有构建错误都消失了,但我无法运行该应用程序.
撤消.改为放入cordova-2.7.0.jar
项目libs/
目录.这不仅会将它添加到您的构建路径中,而且还会将JAR的内容打包到您的APK中,而"添加外部JAR ..."则不会.
至于为什么这个JAR在libs/
创建项目时没有自动输入,我无法回答,因为我没有尝试过2.7.
归档时间: |
|
查看次数: |
1570 次 |
最近记录: |