0

Getting the following error wile running Flutter code on Android Studio. (Windows 10). I am using android-studio-2020.3.1.22-windows, Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1165], locale en-IN).

Launching lib\main.dart on Android SDK built for x86 in debug mode...

Running Gradle task 'assembleDebug'...

Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01

Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:open_appstore

For solutions, see https://dart.dev/go/unsound-null-safety

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:

Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 11s
Exception: Gradle task assembleDebug failed with exit code 1

Not able to resolve the issue. But it is working, able to see the output when I run the command

flutter run --no-sound-null-safety

from terminal. What seems to be the issue?

GOKU
  • 430
  • 1
  • 4
  • 20

2 Answers2

2

The package you used doesn't support null-safety, use null safety packages.

Haree Prasad
  • 91
  • 1
  • 4
  • but i need it to get ratings from store. If you know any alternative to open_appstore please suggest – GOKU Aug 16 '21 at 13:59
  • use url launcher (package) for opening the app store or play store https://stackoverflow.com/a/61726632/14463585 – Haree Prasad Aug 16 '21 at 14:15
1

The error is telling you to remove this package open_appstore. It doesn't support null-safety. Remove it and it should compile.

Huthaifa Muayyad
  • 11,321
  • 3
  • 17
  • 49
  • but i need it to get ratings from store. If you know any alternative to open_appstore please suggest. – GOKU Aug 16 '21 at 13:59
  • You need your app to compile first. Also, the package mentioned was last updated in 2019. Try to use packages that are constantly being maintained or are stable, and support null-saftey at least. – Huthaifa Muayyad Aug 16 '21 at 14:00