iqbalmineraltown / flutter_sms_receiver

SMS Receiver API Flutter Plugin
BSD 3-Clause "New" or "Revised" License
22 stars 22 forks source link

Only safe (?.) or non-null asserted (!!.) calls are allowed #9

Closed Jai05-techie closed 3 years ago

Jai05-techie commented 4 years ago

After Updating the Android Studio and Gradle its throwing error like below,

"FlutterProjects/SDKFlutter/flutter/.pub-cache/hosted/pub.dartlang.org/sms_receiver-0.3.1+1/android/src/main/kotlin/com/oval/smsreceiver/SMSBroadcastReceiver.kt: (23, 32): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Bundle?"

help me out how to fix this ?!

LucasSpeer commented 3 years ago

@Jai05-techie Navigate to that file, find line 23 and change it from val status = extras.get(SmsRetriever.EXTRA_STATUS) as Status to val status = extras?.get(SmsRetriever.EXTRA_STATUS) as Status

and do the same on line 29

iqbalmineraltown commented 3 years ago

Hi, did you use the same version as the example?

I haven't updated this for more than a year and currently doing fine on actively-maintained apps using flutter 1.12.13-hotfixes I haven't got time for updating this, feel free to open PR

iqbalmineraltown commented 3 years ago

closing this as no updates/further information provided feel free to reopen