简体   繁体   English

Eclipse是否无法将项目导出到APK?

[英]Is Eclipse failing to export the project to APK?

I'm currently getting errors like: 我目前遇到以下错误:

07-15 21:26:43.216: E/dalvikvm(1066): Could not find class 'pctelelog.events.AbstractEvent', referenced from method com.aberdyne.droidnavi.client.EventDispatchThread.dequeueEvent 07-15 21:26:43.216:E / dalvikvm(1066):找不到方法com.aberdyne.droidnavi.client.EventDispatchThread.dequeueEvent引用的类'pctelelog.events.AbstractEvent'

When I try and run on an API16 emulator. 当我尝试在API16模拟器上运行时。

The AbstractEvent exists within another Eclipse Java project. AbstractEvent存在于另一个Eclipse Java项目中。 The Android App uses them to simplify talking to the Java server. Android应用程序使用它们来简化与Java服务器的通话。 The Project was added to the Android project in the Java Build Path > Projects tab. 该项目已在Java Build Path> Projects选项卡中添加到Android项目。

Before anyone asks, I have gone into the Android Build Path > Order and Export and checked the Project to export. 在有人问之前,我进入了Android Build Path> Order and Export,并检查了要导出的项目。 I have tried cleaning the project, building, I have tried placing the project at the top of the export order, "Fix Properties," re-downloading support libraries. 我尝试清理项目,构建项目,并尝试将项目放在导出顺序“修复属性”的顶部,然后重新下载支持库。 I've tried everything I can think of, even going so far as deleting my eclipse installation and redownloading the latest one. 我已经尝试了所有可以想到的方法,甚至删除了Eclipse安装并重新下载了最新的Eclipse安装。 Here's the truly bizarre part. 这是真正奇怪的部分。

I'm getting the "Could not find class" errors (which lead to NoClassDefFound when the class needs to be instantiated) on my Windows development machine. 我在Windows开发计算机上收到“找不到类”错误(当需要实例化该类时会导致NoClassDefFound)。 However, when I pull an exact copy of the same source tree off Git onto my Mac and build the app in Eclipse, no problems! 但是,当我将同一个源树的确切副本从Git中拉出到我的Mac上并在Eclipse中构建应用程序时,没有问题! Hell, I pulled an earlier release of my app from the repository that I know I built on my windows machine and now that doesn't build either. 地狱,我从我知道我是在Windows计算机上构建的存储库中提取了我的应用程序的较早版本,但现在也没有构建。 The settings appear to match in every way. 设置似乎在所有方面都匹配。

The major difference between my Windows and Mac are the ADT version. Windows和Mac之间的主要区别是ADT版本。 Windows running ADT 23.0 and Mac 22.6. Windows运行ADT 23.0和Mac 22.6。 They were running the same version of Eclipse before I deleted the Window one but now Mac is Kepler and Win, Luna. 在我删除Window之前,他们运行的是相同版本的Eclipse,但是现在Mac是Kepler and Win,Luna。

Any suggestions on what else I could try to get this to export right? 关于我还可以尝试将其正确导出的任何建议? Is this a bug in Eclipse? 这是Eclipse中的错误吗?

Looking over the Maven POM that builds the Java project and I decided to try setting the source/target java to 1.6 (it was 1.7), and after doing that the problem appears to have been resolved. 查看构建Java项目的Maven POM,我决定尝试将源Java /目标Java设置为1.6(原来是1.7),然后问题似乎已经解决。

Like so: 像这样:

 <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
 </plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM