0

I have a flutter app and its working fine in debug mode but when i run flutter build apk command for android apk it shows the following error. The error is cannot run with sound null safety. Error:

 C:\Users\RAILO\flutter\bin\flutter.bat --no-color build apk

 Building with sound null safety 

Running Gradle task 'assembleRelease'...                        
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:flutter_swiper
 - package:flutter_page_indicator
 - package:transformer_page_view

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


FAILURE: Build failed with an exception.
Qasim Ali
  • 434
  • 2
  • 5
  • 31

2 Answers2

1

Add this line on top of main.dart

// @dart=2.9

then run $flutter clean && flutter pub get

takudzw_M
  • 186
  • 1
  • 5
1

you can try this command also.

flutter build apk --release --no-sound-null-safety
Hardik Mehta
  • 2,195
  • 1
  • 11
  • 14