2

I'm getting this warning: 'Registrar' is deprecated. Deprecated in Java' any time I run flutter build apk. This is the error dialogue in android studio: :\Users\df\Desktop\flutter.pub-cache\hosted\pub.dartlang.org\app_settings-4.2.0\android\src\main\kotlin\com\example\appsettings\AppSettingsPlugin.kt:16:48: warning: 'Registrar' is deprecated. Deprecated in Java import io.flutter.plugin.common.PluginRegistry.Registrar ^

I run flutter build apk and this error always pop up

1 Answers1

1

The warning you're seeing is indicating that the class 'Registrar' is deprecated in the app_settings library you're using (version 4.2.0). This means that the class is no longer recommended for use and may be removed in a future version.

This class is part of the Flutter plugin system and is used to register plugins with the Flutter engine. In the latest versions of Flutter, the plugin registration process has been updated and the Registrar class is no longer needed.

To resolve this warning, you can try updating to a newer version of the app_settings library that does not use the deprecated Registrar class. You can check the latest version of the library on the pub.dev website.

Alternatively, you can try using a different library that provides similar functionality and is compatible with the latest version of Flutter.

It's also good to check that your app's dependencies are up-to-date and that you have the latest version of the Android Studio and all the necessary dependencies installed.

You can also try cleaning and rebuilding the project and running the app on different emulators or devices to see if the issue is specific to the device you are currently testing on.

Fruze Lee
  • 41
  • 1
  • Thanks alot. I was using the latest version of app_settings but still getting the same error. The app works perfectly in debug mode. But I will try other steps you have shown me. – Albert Tetteh Adjei Jan 25 '23 at 17:35
  • You're welcome. It sounds like you're using the latest version of the app_settings plugin, but the plugin itself may not be compatible with the latest version of Flutter. To fix this, you can try a few things: Check the plugin's documentation and see if there's a version that's compatible with the latest version of Flutter. If there is, try updating to that version. Look for a fork of the plugin that's been updated to be compatible with the latest version of Flutter. – Fruze Lee Jan 26 '23 at 06:04
  • If you can't find a compatible version of the plugin, try removing it from your project and replacing it with an alternative plugin that does the same thing. If you still have the same issue, try to submit an issue on the plugin's Github repository and asking for help. It's also worth noting that the warning message you're seeing is just a warning and should not prevent the app from running correctly. But it's still better to fix it. I hope this helps! – Fruze Lee Jan 26 '23 at 06:04
  • please can u help me with Google mobile ads code snippet? What I'm using produce a white rectangular shape at the bottom of my flutter app? A code snippet will be appropriate – Albert Tetteh Adjei Feb 03 '23 at 14:46