android: Parse.com Parseobject classnotfound error

2019-02-21 00:03发布

问题:

I use Parse.com's library in my android application and i get the following error.

05-26 18:43:31.838: E/AndroidRuntime(4759): FATAL EXCEPTION: main 05-26 18:43:31.838: E/AndroidRuntime(4759): java.lang.NoClassDefFoundError: com.parse.ParseObject 05-26 18:43:31.838: E/AndroidRuntime(4759): at com.parse.starter.ParseStarterProjectActivity.onCreate(ParseStarterProjectActivity.java:14) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.ActivityThread.access$1500(ActivityThread.java:123) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.os.Handler.dispatchMessage(Handler.java:99) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.os.Looper.loop(Looper.java:130) 05-26 18:43:31.838: E/AndroidRuntime(4759): at android.app.ActivityThread.main(ActivityThread.java:3835) 05-26 18:43:31.838: E/AndroidRuntime(4759): at java.lang.reflect.Method.invokeNative(Native Method) 05-26 18:43:31.838: E/AndroidRuntime(4759): at java.lang.reflect.Method.invoke(Method.java:507) 05-26 18:43:31.838: E/AndroidRuntime(4759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847) 05-26 18:43:31.838: E/AndroidRuntime(4759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605) 05-26 18:43:31.838: E/AndroidRuntime(4759): at dalvik.system.NativeStart.main(Native Method)

Please help me solve this

回答1:

I had the same issue with Parse and Android for some crazy reason after checking the SDK versions i noticed there was no Target SDK version, but there was one for Min SDK version. I just added the target SDK version ( 8 in this case ) to match the Min version and it works. I guess Parse checks for target SDK version or something.



回答2:

I hope this may helpful for you.

Open project's properties.

Click on java build path.

Click order and export tab and click on parse jar file to check this.

And build and clean your project then run.