15

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.
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
  • 3
    As described in your log message this is not an Error, but simply a "Note" on the console. The build will typically be successful, unless there are any other errors. – illuminate Jul 14 '19 at 14:10

1 Answers1

12

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.

creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
  • 4
    "This is just a warning, not an error" is not a very good philosphy to foollow. THe compiler generates an warning because there is a potential problem which may not break your app right away but may become a bottoleneck in future. – Sisir Nov 01 '20 at 05:42