使用Eclipse2020-09创建android项目会导致错误的包树
我正在努力在eclipse中建立一个android项目(2020-09;以及更多的0.5.1) 在经历了许多令人沮丧的错误和令人沮丧的过时答案之后,我从eclipse中卸载了所有android插件,只安装了更多 现在我得到:使用Eclipse2020-09创建android项目会导致错误的包树,android,eclipse,Android,Eclipse,我正在努力在eclipse中建立一个android项目(2020-09;以及更多的0.5.1) 在经历了许多令人沮丧的错误和令人沮丧的过时答案之后,我从eclipse中卸载了所有android插件,只安装了更多 现在我得到: The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then tr
The project was not built since its build path is incomplete.
Cannot find the class file for java.lang.Object. Fix the build path then try building this project MyappA
(生成的)代码是:
仔细看,第一行有一个错误:
声明的包“com.myappa”与预期的包“src.com.myappa”不匹配
所以我的问题是,为什么eclipse认为预期的包是src.com.myappa,我如何修复它
毕竟,正是eclipse决定在该位置生成该类。我要问一个显而易见的问题,那就是,为什么要在2020年使用eclipse?Android Studio是唯一一个得到官方支持的IDE,已经有好几年了。@IvanWooll简单的回答:我习惯于在我的手指知道该做什么的地方使用eclipse。但如果eclipse失败,Android studio将是一条出路。在短期内,切换到AS可能会给您带来一些挫折,就像更改IDE时一样。在中期,你会发现有很多事情可以帮助你的日常生活,你会很高兴你改变了。为了帮助转换,您可以使用Eclipse密钥映射enable@IvanWooll所以我尝试了没有eclipse的android studio。。。更相似的是:创建一个新项目会出现一些神秘的错误,比如缺少签名,无法在虚拟设备上安装。复制和重命名现有的工作项目。在虚拟设备上运行,但看不到我的真实设备。我在网上看到的关于后者的信息让我看到了一些不存在或看起来很不一样的标签。更令人沮丧的是,大约5年前,我通过一些努力建立了一个工作项目,但没有这些问题,这些问题不是来自应用程序的复杂性,而是来自行为不端的工具。
package com.myappa;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}