Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter plugin: InAppPurchasePlugin.java uses unchecked or unsafe operations

When i am trying to just add the in_app_purchase plugging in the apps pubspec.yaml file the following error is occurred.

Just after adding the plugin. not related to any specific code.

Note: /Users/tanzimfahim/flutter/.pub-cache/hosted/pub.dartlang.org/in_app_purchase-0.2.0+3/android/src/main/java/io/flutter/plugins/inapppurchase/InAppPurchasePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
like image 915
Tanzim Hasan Fahim Avatar asked Jul 08 '19 20:07

Tanzim Hasan Fahim


People also ask

Are all flutter plugins tested?

Most plugins, certainly all Flutter favorites, are tested. If unchecked or unsafe operations are left in, the authors have determined that these operations are fine in their use case.

How to know about unchecked or unsafe operations in Java?

If you want to know about unchecked or unsafe operations, you can use below command: Note: PrintArrayListMain.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. How to resolve warning message: uses unchecked or unsafe operations.

What does the unchecked or unsafe operations warning mean?

The "unchecked or unsafe operations" warning is very common. This is just a warning, not an error. These warnings will only appear when you compile the plugin for the first time, i.e. every time you use flutter clean or add a new plugin; generally when you compile a plugin for the first time.

Does printarraylistmain use Unchecked or unsafe operations?

Note: PrintArrayListMain.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. As you can see, compile gives us warning message that PrintArrayListMain.java uses unchecked or unsafe operations.


1 Answers

Unchecked or unsafe operations

When adding plugins to Flutter and running your app on Android, you will often see warnings. The "unchecked or unsafe operations" warning is very common.

They are fine

You do not have to worry about it because:

  • This is just a warning, not an error. These warnings will only appear when you compile the plugin for the first time, i.e. every time you use flutter clean or add a new plugin; generally when you compile a plugin for the first time.

  • Most plugins, certainly all Flutter favorites, are tested. If unchecked or unsafe operations are left in, the authors have determined that these operations are fine in their use case.

What can you do about them?

As I outlined above, you do not have to do anything about them.

What you can do is file an issue about it or create a pull request directly to either suppress the warning or find an alternative solution in code.

like image 174
creativecreatorormaybenot Avatar answered Sep 23 '22 06:09

creativecreatorormaybenot