简体   繁体   中英

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

When I try and run on an API16 emulator.

The AbstractEvent exists within another Eclipse Java project. The Android App uses them to simplify talking to the Java server. The Project was added to the Android project in the Java Build Path > Projects tab.

Before anyone asks, I have gone into the Android Build Path > Order and Export and checked the Project to 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. 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. 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! 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. The settings appear to match in every way.

The major difference between my Windows and Mac are the ADT version. Windows running ADT 23.0 and 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.

Any suggestions on what else I could try to get this to export right? Is this a bug in 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.

Like so:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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