Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some input files use or override a deprecated API Flutter build android [closed]

I have a flutter project and I want to build it in android studio. I build it with this command in the terminal:

flutter build apk --release

I'm getting this error report:

Note: C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.5.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides
 a deprecated API.
Note: Recompile with -Xlint: deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint: deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint: unchecked for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint: unchecked for details.
C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warn
ing: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());

I'm not a flutter developer so I have no special knowledge of these technologies. I have upgraded flutter and the flutter doctor did not find any error what problem? Could you help me too? Give advice on what I’m doing wrong.

like image 934
Britanik Avatar asked Apr 03 '20 13:04

Britanik


People also ask

What is recompile with Xlint in Java?

By "recompile with -Xlint", the compiler means to inform you that you need to recompile your program like this: javac -Xlint abc.java. If you do so, the compiler will tell you which methods are deprecated so you can remove your calls to them.


1 Answers

This is a known issue with the shared_preferences plugin with flutter. This issue has been addressed about 20 days ago. Make sure that you are using the newest version of shared_preferences (0.5.6+3) and update to reflect this in your pubspec.yaml.

like image 181
Vishvak Seenichamy Avatar answered Sep 22 '22 09:09

Vishvak Seenichamy