简体   繁体   中英

Android App Error: java.lang.NoClassDefFoundError

Okay,

So I'm working on an Android app but get the following error:

java.lang.NoClassDefFoundError in com.networkstudios.app.LoginActivity.
java.lang.NoClassDefFoundError: com.networkstudios.app.LoginActivity$1 at com.networkstudios.app.LoginActivity.(LoginActivity.java:37) at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Instrumentation.newActivity(Instrumentation.java:1068) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2007) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117) at android.app.ActivityThread.access$700(ActivityThread.java:134) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4867) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007) at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:774) at dalvik.system.NativeStart.main(Native Method)

Here is the code for LoginActivity.java found in com.networkstudios.app:

http://pastebin.com/4dMxD8nb

Any Ideas on this?

The error means that your code is not able to find facebook API classes at runtime . Ensure that you have facebook.jar in your classpath when you run your code.

If you have facebook SDK in your classpath while running the code and still facing the issue then try this:

Just replace the android-support-v4.jar of your project that is in>lib folder with android-support-v4.jar present in FacebookSDK>libs folder

as mentioned on these posts:

{Facebook Login} java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager

Android facebook SDK doing error java.lang.NoClassDefFoundError‎

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