Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] - app crashed when click on back button #83

Closed
uyit14 opened this issue Feb 23, 2021 · 5 comments
Closed

[Android] - app crashed when click on back button #83

uyit14 opened this issue Feb 23, 2021 · 5 comments

Comments

@uyit14
Copy link

uyit14 commented Feb 23, 2021

When i open another app from my app and then click default back button to go back my app -> crash
D/AndroidRuntime(26074): Shutting down VM
E/AndroidRuntime(26074): FATAL EXCEPTION: main
E/AndroidRuntime(26074): Process: com.cosmosum.nonprod.staging, PID: 26074
E/AndroidRuntime(26074): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(26074): at br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$MainThreadEventSink$1.run(FlutterBranchSdkPlugin.java:691)
E/AndroidRuntime(26074): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(26074): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(26074): at android.os.Looper.loop(Looper.java:237)
E/AndroidRuntime(26074): at android.app.ActivityThread.main(ActivityThread.java:8129)
E/AndroidRuntime(26074): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26074): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
E/AndroidRuntime(26074): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
I/System.out(26074): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(26074): (HTTPLog)-Static: isSBSettingEnabled false

@RodrigoSMarques
Copy link
Owner

I didn't understand: "When I open another app from my app and then click default back button to go back my app".

Can you give me an example of an application being opened so I can try to reproduce the error?

@uyit14
Copy link
Author

uyit14 commented Feb 23, 2021

This is flow:

  1. At "My App" click on a phone_number to open Phone app (the code is: launch('tel:${"84357xxxxxx"}');) -> Phone app opened
  2. Click OS back button -> app crash with above information.

@uyit14
Copy link
Author

uyit14 commented Feb 23, 2021

I added below code to FlutterBranchSdkPlugin.java and crash is not happen now.
public void success(final Object o) { handler.post(new Runnable() { @Override public void run() { if (eventSink != null) { eventSink.success(o); } } }); }

@RodrigoSMarques
Copy link
Owner

Hi @uyit14

A new release was planned tomorrow because of the new version of the SDK for iOS, I will include this fix in this release.

Thanks.

@uyit14
Copy link
Author

uyit14 commented Feb 23, 2021

@RodrigoSMarques Thanks alot.

RodrigoSMarques added a commit that referenced this issue Feb 25, 2021
Updated Native `Android` and `iOS` SDKs
* Android Native SDK Update 5.0.5 - [Android Version History](https://help.branch.io/developers-hub/docs/android-version-history)
* iOS Native SDK Update 1.38.0 - [iOS Version History](https://help.branch.io/developers-hub/docs/ios-version-history)
* Fix issue #83 - [Android - app crashed when click on back button] (#83)
* Fix deprecated API usage warning
RodrigoSMarques added a commit that referenced this issue Feb 25, 2021
* Updated Native `Android` and `iOS` SDKs:
**Android Native SDK Update 5.0.5 - [Android Version History](https://help.branch.io/developers-hub/docs/android-version-history)
**iOS Native SDK Update 1.38.0 - [iOS Version History](https://help.branch.io/developers-hub/docs/ios-version-history)
* Fix issue #83 - [Android - app crashed when click on back button](#83)
* Fix deprecated API usage warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants