Reputation: 2692
This problem has been haunting me down. I have spend enormous time to solve this issue but failed. First of all I am using latest SDK (version 22).
Whenever I add Facebook to my project via Preferences>Android>Library, I get error in console showing this.
[2014-06-03 15:15:04 - Test] Found 3 versions of android-support-v4.jar in the dependency list,
[2014-06-03 15:15:04 - Test] but not all the versions are identical (check is based on SHA-1 only at this time).
[2014-06-03 15:15:04 - Test] All versions of the libraries must be the same at this time.
[2014-06-03 15:15:04 - Test] Versions found are:
[2014-06-03 15:15:04 - Test] Path: /home/bipin/NewProjectsWorkspace/Test/libs/android-support-v4.jar
[2014-06-03 15:15:04 - Test] Length: 648327
[2014-06-03 15:15:04 - Test] SHA-1: ded9acc6a9792b8f1afc470f0c9cd36d178914cd
[2014-06-03 15:15:04 - Test] Path: /home/bipin/Desktop/facebook-android-sdk-3.14.1/facebook/libs/android-support-v4.jar
[2014-06-03 15:15:04 - Test] Length: 621451
[2014-06-03 15:15:04 - Test] SHA-1: 5896b0a4e377ac4242eb2bc785220c1c4fc052f4
[2014-06-03 15:15:04 - Test] Path: /home/bipin/NewProjectsWorkspace/appcompat_v7/libs/android-support-v4.jar
[2014-06-03 15:15:04 - Test] Length: 648327
[2014-06-03 15:15:04 - Test] SHA-1: ded9acc6a9792b8f1afc470f0c9cd36d178914cd
[2014-06-03 15:15:04 - Test] Jar mismatch! Fix your dependencies
Then I tried replacing android-support-v4.jar file from Facebook's libs folder to my Test project and appcompat_v7 project. This shows following error in logcat:
06-03 15:20:29.101: E/AndroidRuntime(14303): FATAL EXCEPTION: AsyncTask #1
06-03 15:20:29.101: E/AndroidRuntime(14303): java.lang.RuntimeException: An error occured while executing doInBackground()
06-03 15:20:29.101: E/AndroidRuntime(14303): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
06-03 15:20:29.101: E/AndroidRuntime(14303): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.lang.Thread.run(Thread.java:841)
06-03 15:20:29.101: E/AndroidRuntime(14303): Caused by: java.lang.NullPointerException
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:911)
06-03 15:20:29.101: E/AndroidRuntime(14303): at com.facebook.internal.Utility.queryAppSettings(Utility.java:372)
06-03 15:20:29.101: E/AndroidRuntime(14303): at com.facebook.widget.LoginButton$1.doInBackground(LoginButton.java:676)
06-03 15:20:29.101: E/AndroidRuntime(14303): at com.facebook.widget.LoginButton$1.doInBackground(LoginButton.java:1)
06-03 15:20:29.101: E/AndroidRuntime(14303): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-03 15:20:29.101: E/AndroidRuntime(14303): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-03 15:20:29.101: E/AndroidRuntime(14303): ... 4 more
There is nothing related to AsyncTask
in my Activity
. I guess its related to FB SDK.
Can anyone help how to solve this issue please..
Upvotes: 1
Views: 1903
Reputation: 2692
I was about to start a bounty and I was checking HelloFacebookSample and decided to give it a try.
I was putting my app id as this:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="MY_APP_ID"/>
but what it should have been:
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
I never thought this could create such an error. They should put this as warning in their tutorial I guess!
Upvotes: 6