facebook-android-sdk
facebook-android-sdk copied to clipboard
FacebookRequestErrorClassification in com.facebook.internal package causes Crash.
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing Github issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [x] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Java version
JavaVersion.VERSION_1_8
Android version
All
Android SDK version
16.0.0
Installation platform & version
maven
Package
Core & AppEvents
Goals
Currently, I removed facebook sdk from my app and redeployed the updated version. But existing users should update their app in order to use my app without crashing on start. I want existing users (whom not using updated app) to be able to use my app without crashing on start.
Expected results
I expect the app should not be crashed on start up just by importing this sdk.
Actual results
It roughly started from 2023/4/15 11 am (kst)
Steps to reproduce
I don't know exactly how to reproduce this bug. We have 2 apps using different 'facebook app' project (Dev and Prod). Only Prod app crashes. The only significant difference between Dev app and Prod app is that prod app is currently disabled (I don't know why. But it says my app violated the policy, which I appealed about 3 weeks ago, but still no reply or action received)
Code samples & details
https://github.com/facebook/facebook-android-sdk/blob/27999c3aa530bab04eff6f018cf754d58fa1a92b/facebook-core/src/main/java/com/facebook/internal/FetchedAppSettingsManager.kt#L129
=>
https://github.com/facebook/facebook-android-sdk/blob/27999c3aa530bab04eff6f018cf754d58fa1a92b/facebook-core/src/main/java/com/facebook/internal/FetchedAppSettingsManager.kt#L225
=>
https://github.com/facebook/facebook-android-sdk/blob/27999c3aa530bab04eff6f018cf754d58fa1a92b/facebook-core/src/main/java/com/facebook/internal/FacebookRequestErrorClassification.kt#L117
definition (parameter) has value
{"name":"login_recoverable","recovery_message":"Facebook 계정을 다시 연결하려면 앱에 다시 로그인하세요."}
json string without list key. So the app crashes.
I am facing the same issue
I am having the same problem, it does not let my application start and it directly crashes
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int org.json.JSONArray.length()' on a null object reference at com.facebook.internal.FacebookRequestErrorClassification$Companion.parseJSONDefinition(FacebookRequestErrorClassification.kt:118) at com.facebook.internal.FacebookRequestErrorClassification$Companion.createFromJSON(FacebookRequestErrorClassification.kt:166) at com.facebook.internal.FetchedAppSettingsManager.parseAppSettingsFromJSON$facebook_core_release(FetchedAppSettingsManager.kt:225) at com.facebook.internal.FetchedAppSettingsManager.loadAppSettingsAsync$lambda-0(FetchedAppSettingsManager.kt:129) at com.facebook.internal.FetchedAppSettingsManager.$r8$lambda$0Zs5KScD9YcdRdfqSQiSgW_MgdQ() at com.facebook.internal.FetchedAppSettingsManager$$ExternalSyntheticLambda0.run(:6) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
Guys, the same issue. On All our Android apps (10+). Need help!!!
As i see the app tries to run getAppSettingsQueryResponse(applicationId)
but it returns {"android_sdk_error_categories":[{"name":"login_recoverable","recovery_message":"Please log into this app again to reconnect your Facebook account."}],"id":"..."}
.
Then definition.optJSONArray("items")
returns nil and itemsArray.length()
raises NPE.
+1
+1
I just deleted
implementation 'com.facebook.android:facebook-android-sdk:latest.release'
in gardle.build. it's a temproray fix
The problematic file was not modified since ages ago. It's not a latest sdk issue. Their server should be fixed to match the json structure of android sdk, in order to make apps work without update. Fix in android sdk cannot be a true solution.
+1
It is a latest bugs can someone help us, I am also getting the same.
Same here
It suddenly started to work
+1
Not working for our application which is in production right now...
The problematic file was not modified since ages ago. It's not a latest sdk issue. Their server should be fixed to match the json structure of android sdk, in order to make apps work without update. Fix in android sdk cannot be a true solution.
Ok, but what can we do right now with our production applications?
It suddenly started to work
Still working for you? For us it's still crashing in production..
There is nothing you can do except for deleting facebook-android-sdk completely from your app and deploy new version. And pray that your users will update to new version without deleting your app. That is what I did too.
Guys, the same issue. On All our Android apps (10+). Need help!!!
As i see the app tries to run
getAppSettingsQueryResponse(applicationId)
but it returns{"android_sdk_error_categories":[{"name":"login_recoverable","recovery_message":"Please log into this app again to reconnect your Facebook account."}],"id":"..."}
. Thendefinition.optJSONArray("items")
returns nil anditemsArray.length()
raises NPE.
Did you managed it somehow?
There is nothing you can do except for deleting facebook-android-sdk completely from your app and deploy new version. And pray that your users will update to new version without deleting your app. That is what I did too.
If i remove the library that uses facebook-android-sdk it works. But, I need to use react-native-fbsdk-next in order to login with facebook within a react-native application.
How can I do it now if the react-native-fbsdk-next uses facebook-android-sdk, and the react-native-fbsdk-next is the latest library for facebook login?
Same issue on SDK 14.1.1
I feel like this happened because my app was disabled on developers.facebook.com because of an issue one month ago to which I forgot to reply. It was deactivated on the same day (22.apr) that the issue started, so I thought it had been blocked because of this issue, not the other way around.
Still it has never happened that the app would crash when in developer mode. It is a bit bizarre but it could be the flutter package or some interface in-between causing the crash issue?
Guys, the same issue. On All our Android apps (10+). Need help!!!
As i see the app tries to run
getAppSettingsQueryResponse(applicationId)
but it returns{"android_sdk_error_categories":[{"name":"login_recoverable","recovery_message":"Please log into this app again to reconnect your Facebook account."}],"id":"..."}
. Thendefinition.optJSONArray("items")
returns nil anditemsArray.length()
raises NPE.Did you managed it somehow?
So, our app was suspended. I missed it one issue in configs, so, I resolved issue, in developer console made app live again and it started work. So, check you app in console - maybe this one will help too. App should be live.
My app is now in a deadlock, that's great:
They won't approve my app again because they can't open the app.
The app won't open because they blocked it.