Skip to content

[documentation] Gradle option to disable sound-nullsafety in android native #80426

@sjoerd0301

Description

@sjoerd0301

When I try to make project in Android Studio in the android folder, I encountered this:

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

for clarification: the list of dependencies is empty.

// @dart=2.9 doesn't work if the app is already migrated to null-safety. because that disables late, ! and other features
The flutter run/build tool provides a --no-sound-null-safety function

But it isn't sound-nullsafe because not all packages I use have been migrated, and without those packages the app is worthless.

Steps to Reproduce

  1. Create a flutter app using null-safety
  2. import one of the following packages:
  • package:flutter_form_builder
  • package:flutter_ble_lib
  • package:flutter_chips_input
  • package:flutter_datetime_picker
  • package:rating_bar
  • package:validators
  1. compile the app in android studio (non-native) with the --no-sound-null-safety option --> this works
  2. open the android folder in android studio compile: this doesn't work because of Cannot run with sound null safety, because the following dependencies don't support null safety:

What I'd like to see is a gradle option to be able to debug native code

Logs

Logs
[✓] Flutter (Channel stable, 2.0.4, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.4 at ///tools/flutter
    • Framework revision b1395592de (13 days ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /home/sjoerd/tools/android
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /home/sjoerd/tools/android
    • ANDROID_SDK_ROOT = /home/sjoerd/tools/android
    • Java binary at: /usr/java/jdk1.8.0_261/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at
      ///.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.6693.111
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.55.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.21.0

[✓] Connected device (2 available)
    •
    • 

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: null-safetySupport for Dart's null safety featured: api docsIssues with https://api.flutter.dev/team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions