When clicking on 'OK' button application crashes with message 'Unfortunately, App has stopped'

Here is log:
--------- beginning of crash
09-21 16:28:57.346 2876 2876 E AndroidRuntime: FATAL EXCEPTION: main
09-21 16:28:57.346 2876 2876 E AndroidRuntime: Process: com.app, PID: 2876
09-21 16:28:57.346 2876 2876 E AndroidRuntime: java.lang.AbstractMethodError: abstract method "void com.facebook.react.bridge.ActivityEventListener.onActivityResult(android.app.Activity, int, int, android.content.Intent)"
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:210)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.facebook.react.XReactInstanceManagerImpl.onActivityResult(XReactInstanceManagerImpl.java:612)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:134)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:77)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.app.MainActivity.onActivityResult(MainActivity.java:21)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:6428)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.ActivityThread.-wrap16(ActivityThread.java)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-21 16:28:57.346 2876 2876 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-21 16:28:57.347 1518 2061 W ActivityManager: Force finishing activity com.app/.MainActivity
Just to mention, the same App works on iOS without any problems
Best regards
Sumi
java.lang.AbstractMethodError is thrown when an application tries to call an abstract method. Please make sure you override the onActivityResult() in MainActivity.js
Hi @dzhuowen,
thanks for reply.
Do you mean of MainActivity.java ?
If you do, there is already override there:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
}
Best regards
I've experienced the same issue after migrating from react-native 0.28 to 0.33.
Did follow all the migration steps, changed my Java Template, etc. but can't get pass this.
Public void onSuccess(LoginResult loginResult)
is being called and then the app crashes
I got the same error using LoginManager and LoginButton. Log:
java.lang.AbstractMethodError: abstract method "void com.facebook.react.bridge.ActivityEventListener.onActivityResult(android.app.Activity, int, int, android.content.Intent)"
at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:210)
at com.facebook.react.XReactInstanceManagerImpl.onActivityResult(XReactInstanceManagerImpl.java:612)
at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:134)
at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:77)
at android.app.Activity.dispatchActivityResult(Activity.java:6299)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3684)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3731)
at android.app.ActivityThread.access$1300(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5430)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
When i try and launch the SDK from the login button, it crashes on my Galaxy s7. In my emulator, it crashes after attempting to login.
I experience the same error on RN 0.33
There's been some sort of change for onActivityResult in 0.33
https://github.com/facebook/react-native/commit/fbd2e139103e3d520f6dfc009d6200f8b8168e35
Might be related to that
Also a documentation change for onActivityResult: https://github.com/facebook/react-native/pull/9985/commits/6680f22bae9a76862680789bae596dc544274193
We are experiencing the same issue after upgrading react-native from 0.29 to 0.34, any updates on something we could do to avoid this crash ?
I've also reported here
https://github.com/facebook/react-native/issues/10101
@dzhuowen can you please look into this. Its really a blocker now.
I tried several ways but could not find the solution.
Can someone point me to right direction / workaround ?
@Vani-gurnani, please file a bug in https://developers.facebook.com/bugs/ for quicker response
Any updates on this issue? Encountered this exact same issue when updating RN from 0.30 to 0.34
For the record, I was having this problem as well. After reading this thread it gave me a hint where to look. I had an ActivityListener onActivityResult(final int requestCode, final int resultCode, final Intent intent) function (using the old signature) in my native code. That particular function didn't do anything and after I removed reactContext.addActivityEventListener(this); the problem was gone. It's possible that all onActivityResult functions should now be written with the new signature (including the Activity argument) and otherwise the crash occurs.
@IjzerenHein is correct, there was a breaking change in react native, and the signature of the onActivityResult needs to change if you have a listener.
Hi,
Does anyone know a solution for this problem?
Thanks
@Fatxx
At my code, react-native-fbsdk was not bugged. When I tryed to click "OK" button, it crashed.
But, the culprit was another library who used "onActivityResult" of old version react-native.
So, react-native-fbsdk crashed because another library which was not updated.
Try to update the external libraries
Yes, was that the issue. Another external lib isn't updated. Thank you anyway.
@Fatxx Any ideas which lib was causing the error?
For me was react-native-image-picker
2016-10-20 13:00 GMT+01:00 Simon Holmes [email protected]:
@Fatxx https://github.com/Fatxx Any ideas which lib was causing the
error?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native-fbsdk/issues/289#issuecomment-255086263,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjH96W7pLNuDt_Y-MkBko0T09l2-wvMks5q11fygaJpZM4KC5wm
.
Cumprimentos,
_André Fatia_
Hi,
for me also was problem with react-native-image-picker.
Best regards
Most helpful comment
I've also reported here
https://github.com/facebook/react-native/issues/10101