-1

I have dug deep on this topic and the following is what i have done :

  1. Tried re-arranging the gen and src folder.
  2. Checked all the stuffs in Order and Export Tab in Java build Path (Did that for my library package also). 3.Cleaned the project n number of times. 4.Tried Organizing imports. 5.Tried Fix Project Properties.

The best part here is that this error is thrown often but not always. At times, it would work if i clean the project and at times if i restart my eclipse and at times if i disconnectr and reconnect my device. This is silly. Any insights on this will be highly appreciated. Hope there is a genius out there who can solve this issue once for all.

P.S : I am using Facebook connectivity in my app and everytime i start this app this error might pop-up restructing me from logging in but at times it would let me pass.

UPDATE :

LOG :

12-23 17:58:47.950: E/AndroidRuntime(6351): java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager
12-23 17:58:47.950: E/AndroidRuntime(6351):     at com.facebook.AppEventsLogger.flushAndWait(AppEventsLogger.java:805)
12-23 17:58:47.950: E/AndroidRuntime(6351):     at com.facebook.AppEventsLogger.access$1(AppEventsLogger.java:777)
12-23 17:58:47.950: E/AndroidRuntime(6351):     at com.facebook.AppEventsLogger$2.run(AppEventsLogger.java:650)
12-23 17:58:47.950: E/AndroidRuntime(6351):     at java.util.Timer$TimerImpl.run(Timer.java:284)
12-23 17:58:51.970: I/OnActivityResult(6351): Inside OnActivityResult
12-23 17:58:52.100: I/System.out(6351): Before the JSON
San
  • 2,078
  • 1
  • 24
  • 42

2 Answers2

1

Maybe you are missing some activity declaration in your manifest. For example if you are using facebook the login activity must be declared.

<activity android:name="com.facebook.LoginActivity" > </activity>

If an activity declaration is forgotten you will have an error only when this activity is accessed (from your code). But it would be much simpler to understand your problem if you post your logcat output.

hakanostrom
  • 1,081
  • 8
  • 15
  • Is that an default activity in Facebook class that need to be added in the manifest file of the app that uses facebook ? – San Dec 23 '13 at 12:28
  • Correct, it´s used for the (SSO)login. Read about it in the FB-tutorial: https://developers.facebook.com/docs/android/getting-started/. – hakanostrom Dec 23 '13 at 12:32
  • It already exists in manifest file, i just saw it but thanks for pointing this out. It could help me in future. Any other thoughts or alternatives that you can think of ? – San Dec 23 '13 at 12:38
  • Maybe this can help, http://stackoverflow.com/questions/16602584/error-java-lang-noclassdeffounderror-android-support-v4-content-localbroadcas – hakanostrom Dec 23 '13 at 12:43
  • I have gone through it but no use. I decided to post this question as i saw various comments on how this issue had been solved for some and some are still helpless. Thanks for taking the effort though. – San Dec 23 '13 at 12:49
0

I have found the solution finally. Try following these steps :(Deals with Facebook Connectivity)

1.In the Order and Export Tab,make sure the android.support.v4 library is checked(if you are using the app with a version above 4.0) and select all the libraries in the Order and Export Tab.
2.Check whether the android.support.v4.jar exists in the libs folder of FacebookSDK which will act as a library project for your project.
3.Android Tools->Fix Project Properties.
4.Clean your project.

Check out the image below. This should be the Order and Export Tab of your project.

enter image description here

Hope it helps.

San
  • 2,078
  • 1
  • 24
  • 42