DroidGap无法解析成型DroidGap

2023-09-04 11:52:39 作者:请别让我记得

您好,我正在一个错误DroidGap不能被解析为一个类型 我的code是

 包com.hello.ponegap;

进口android.app.Activity;
进口android.os.Bundle;
进口com.hello *。

公共类HelloponegapActivity扩展DroidGap {
  / **第一次创建活动时调用。 * /

  @覆盖公共无效的onCreate(包savedInstanceState){
     super.loadUrl(文件:///android_asset/www/index.html);
     super.onCreate(savedInstanceState);
  }
}
 

在此先感谢 另外,我没有得到构建路径,当我用鼠标右键单击LIB

解决方案

添加此行到进口

 进口org.apache.cordova.DroidGap;
 
DNS服务器无法解析地址

编辑:

如果您使用的是Eclipse,你可以使用组合键按Ctrl + Shift + O 组织进口。这删除未使用的进口,也将导入所需的软件包和/或类(如果有多个可能性,例如: android.view.View.OnClickListener android.content.DialogInterface.OnClickListener ,Eclipse将让您有机会选择所需的类进口)。

编辑:

您未在科尔多瓦jar添加到构建路径。我检查你的的.classpath 文件在github上回购,而且缺乏这一行:< classpathentry KIND =LIB路径=库/科尔多瓦-1.8.1.jar/>

解决方法:在 codova-1.xxjar右键单击 - >构建路径 - >添加到构建路径。

请尝试按照定义的here.

修改

执行以下操作:1.右键单击该项目。 2.单击属性。 3.在左侧,选择Java Build Path。 4.您将看到四个选项卡:来源项目订单和出口。选择。 5.在右侧单击按钮添加JAR文件... 。 6.搜索项目中的科尔多瓦-1.xxjar ,并选择它。 7.单击确定。 8.完成

hi i am getting an error that DroidGap cannot be resolved as a type my code is

package com.hello.ponegap;

import android.app.Activity;
import android.os.Bundle;
import com.hello.*;

public class HelloponegapActivity extends DroidGap  {
  /** Called when the activity is first created. */ 

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

thanks in advance also i am not getting build path when i right click on lib

解决方案

Add this line to the imports

import org.apache.cordova.DroidGap;

EDIT:

If you are using Eclipse, you can use the key combination Ctrl + Shift + O to organize imports. This removes unused imports, and also will import the needed packages and/or classes (If there are multiple possibilities, e.g. android.view.View.OnClickListener and android.content.DialogInterface.OnClickListener, Eclipse will give you the chance to select the desired class to import).

EDIT:

You did not add the cordova jar to the build path. I checked your .classpath file on the github repo, and it lacks this line: <classpathentry kind="lib" path="libs/cordova-1.8.1.jar"/>.

Solution: Right-click on the codova-1.x.x.jar -> Build path -> Add to build path.

Please try to follow the steps defined here.

EDIT

Do the following: 1. Right-click the project. 2. Click properties. 3. On the left, select Java Build Path. 4. You see four tabs: Source, Projects, Libraries, Order and Export. Select Libraries. 5. On the right click the button Add JARs.... 6. Search for cordova-1.x.x.jar in your project, and select it. 7. Click OK. 8. Done

相关推荐