Albert Tetteh Adjei
Albert Tetteh Adjei

Reputation: 25

Registrar is deprecated. Deprecated in Java

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

Upvotes: 2

Views: 2076

Answers (1)

Fruze Lee
Fruze Lee

Reputation: 21

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.

Upvotes: 2

Related Questions