Flutter-Mobile-Number-Plugin
Flutter-Mobile-Number-Plugin copied to clipboard
mobile_number/MobileNumberPlugin.java uses or overrides a deprecated API.
Hi, while upgrading to ### flutter v3.22.0
We have this following error on console
../pub.dev/mobile_number-2.1.1/android/src/main/java/com/amorenew/mobile_number/MobileNumberPlugin.java uses or overrides a deprecated API.
To be precise, here is the error
/MethodChannel#mobile_number: Failed to handle method call java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.app.Activity.getSystemService(java.lang.String)' on a null object reference at com.amorenew.mobile_number.MobileNumberPlugin.getSubscriptions(MobileNumberPlugin.java:214) at com.amorenew.mobile_number.MobileNumberPlugin.generateMobileNumber(MobileNumberPlugin.java:180) at com.amorenew.mobile_number.MobileNumberPlugin.getMobileNumber(MobileNumberPlugin.java:171) at com.amorenew.mobile_number.MobileNumberPlugin.onMethodCall(MobileNumberPlugin.java:121) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292) at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319) at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8282) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1074)
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel stable, 3.22.0, on macOS 13.0.1 22A400 darwin-arm64 (Rosetta), locale en-IN) ! Warning:
darton your path resolves to /usr/local/Cellar/dart/2.16.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/user/fvm/versions/3.22.0. Consider adding /Users/user/fvm/versions/3.22.0/bin to the front of your path. [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4) [!] Xcode - develop for iOS and macOS (Xcode 14.1) ! Flutter recommends a minimum Xcode version of 15. Download the latest version or update via the Mac App Store. ! CocoaPods 1.12.1 out of date (1.13.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] Connected device (4 available) [✓] Network resources