[Bug] [Dynamic Links] Dynamic Links callback in Kotlin incorrectly marked as non-null
See original GitHub issue[READ] Step 1: Are you in the right place?
Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:
- For general technical questions, post a question on StackOverflow with the firebase tag.
- For general Firebase discussion, use the firebase-talk google group.
- For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Android Studio version: Arctic Fox 2020.3.1 patch 2
- Firebase Component: Dynamic Links KTX
- Component version: 20.1.1
[REQUIRED] Step 3: Describe the problem
When running the sample code for Dynamic Links in Kotlin, the result of the addOnSuccessListener
is not correctly marked as a nullable type, despite it being possible to return as null.
Steps to reproduce:
- Follow the sample code setup in Kotlin
- Call the sample code with an intent that doesn’t return
pendingDynamicLinkData
- Observe that
null
is returned for the non-nullable type param of the success callback
Relevant Code:
Firebase.dynamicLinks
.getDynamicLink(intent)
.addOnSuccessListener(this) { pendingDynamicLinkData ->
// **BUG** Android Studio reports this check to always be true
// as the typing of pendingDynamicLinkData is not nullable
if (pendingDynamicLinkData != null) {
// some code here ...
}
}
.addOnFailureListener(this) { e -> Log.w(TAG, "getDynamicLink:onFailure", e) }
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Receive Firebase Dynamic Links on Android - Google
To receive the Firebase Dynamic Links that you created, you must include the Dynamic Links SDK in your app and call the FirebaseDynamicLinks....
Read more >Firebase Dynamic Links created dynamically don't work Android
OK, after a while, I find the problem and it was totally JAVA issue: when I send dynamic link from android, I chain...
Read more >Spring Data R2DBC - Reference Documentation
Follow the links in the release notes section to find the version that you want ... To create a query method that supports...
Read more >Core - Android Developers
registerGnssMeasurementsCallback to work around Android R bugs. ... now includes the onPrepareMenu() callback, which is called when a menu is dynamically ...
Read more >JUnit 5 User Guide
The links below highlight some of the combinations you can choose from. ... Denotes that a method is a test factory for dynamic...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, @kazougagh is somehow you are making null type into not null type as Kotlin assert that parameter should not be null when type parameter is not-nullable. Can you modify the code as below to see if it still crashes or not
You can solve this problem by adding these dependencies.
https://developers.google.com/android/guides/releases#december_16_2021