简体   繁体   中英

Getting ClassNotFoundException on Android device when running Eclipse mavenized app

I've got mavenized Android app in Eclipse, which I do build & deploy by running these commands from command line:

mvn clean install
mvn android:deploy

From some moment, I am not able to run my Android app on the device, it crashes with message:

01-24 15:59:44.044: E/AndroidRuntime(25819): FATAL EXCEPTION: main
01-24 15:59:44.044: E/AndroidRuntime(25819): java.lang.RuntimeException: Unable to instantiate application com.mycompany.myPackage.MyClass: java.lang.ClassNotFoundException: Didn't find class "com.mycompany.myPackage.MyClass" on path: /data/app/com.mycompany.myPackage-1.apk
01-24 15:59:44.044: E/AndroidRuntime(25819):    at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
01-24 15:59:44.044: E/AndroidRuntime(25819):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4529)
01-24 15:59:44.044: E/AndroidRuntime(25819):    at android.app.ActivityThread.access$1400(ActivityThread.java:150)
01-24 15:59:44.044: E/AndroidRuntime(25819):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)

I've noticed that during running

mvn clean install

Eclipse pops out a error message:

Updating SVN status: Could not remove \\\\target\\classes\\com\\mycompany\\myPackage\\MyClass.class

If I close Eclipse and build application afterwards with

mvn clean install

then it's fine and app works on device.

Any ideas? Is this Eclipse problem or SVN?

OK, I've managed to solve this issue by running this command on two folders.

svn resolve --accept working target/
svn resolve --accept working target/classes

Still not sure how did svn get to that situation...

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