-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Bug report
[firebase_dynamic_links/unknown] Attempt to invoke virtual method 'android.content.Intent android.app.Activity.getIntent()' on a null object reference
Stack trace:
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296) <asynchronous suspension>
#2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:499) <asynchronous suspension>
#3 MethodChannelFirebaseDynamicLinks.getInitialLink (package:third_party.flutter_plugins.firebase_dynamic_links.interface/src/method_channel/method_channel_firebase_dynamic_links.dart:122) <asynchronous suspension>
#4 DeepLinkHandler.openInitialDeepLink (package:ads.adwords_mobileapp.app.infra.deep_link/deep_link_handler.dart:102)
<asynchronous suspension>
It looks like a native exception is being thrown (and caught) in this try-catch block:
Line 226 in b9f77fd
| try { |
Unfortunately the data we have in the Flutter FirebaseException doesn't specify what line or statement threw in Java, so all we know is that .getIntent() is being called on an Activity that happens to be null.
There is asynchronous logic happening here (the bulk of the logic in FlutterFirebaseDynamicLinksPlugin.getDynamicLink is being performed on a separate thread than the main thread). Is it possible that the Activity could be detached while we wait for a result in lines 239-240, so that by the time we call activity.get() in line 242 it could be null?
Steps to reproduce
Unknown, production crash.
FDL version being used: 4.3.0