Skip to content

【pigeon】Error: This project cannot run with sound null safety, because one or more project dependencies do not #70355

Description

@o0starshine0o

When I run bash:

flutter pub run pigeon pigeons/message.dart

I get this error:

Unhandled exception:
IsolateSpawnException: Unable to spawn isolate: Error: This project cannot run with sound null safety, because one or more project dependencies do not
support null safety:

 - package:pigeon
 - package:args

Run 'pub outdated --mode=null-safety' to determine if versions of your
dependencies supporting null safety are available.
Instance of '_StringStackTrace'pub finished with exit code 255

Here is my pubspec.yaml:

dev_dependencies:
  flutter_test:
    sdk: flutter
  # Pigeon is a code generator tool to make communication between Flutter and the host platform type-safe and easier.
  pigeon: ^0.1.14

and flutter version

Flutter (Channel master, 1.24.0-8.0.pre.191
Flutter version 1.24.0-8.0.pre.191
Framework revision 281522bc87
Engine revision c5cbbb000f
Dart version 2.12.0 (build 2.12.0-31.0.dev)
----

Any suggestion is appreciation. 

@gaaclarke 

Activity

  1. pedromassangocode commented on Nov 12, 2020

    @pedromassangocode

    I will consider this as proposal since as far as I know Pigeon is not migrated to null-safety yet.

  2. gaaclarke commented on Nov 12, 2020

    @gaaclarke
    Member

    Looks like Isolate.spawnUri is spawning a null-safety isolate by default now. Pigeon supports generating null-safe code but itself hasn't been migrated to null-safety. I'll try to switch spawnUri otherwise I'll have to bite the bullet and migrate Pigeon.

  3. gaaclarke commented on Nov 19, 2020

    @gaaclarke
    Member

    This might still be broken. We ran into a problem elsewhere and it seems the language annotation is in the wrong spot: https://github.com/flutter/packages/blob/6cd84e20d974614dbd473f0e00b84b2655a9cc60/packages/pigeon/bin/pigeon.dart#L37

    This may have fixed running pigeon without flags, and possibly otherwise if your input file had a language annotation. The next version of pigeon will address moving the import. If anyone is running into this after 0.1.15 let me know, please.

  4. belinwu commented on Nov 20, 2020

    @belinwu

    Still be broken on pigeon 0.1.15

    flutter pub run pigeon --input pigeons/message.dart --dart_out lib/pigeon.dart --objc_header_out ios/Runner/pigeon.h --objc_source_out ios/Runner/pigeon.m --java_out ./android/app/src/main/java/dev/flutter/pigeon/Pigeon.java --java_package "dev.flutter.pigeon"
    Unhandled exception:
    IsolateSpawnException: Unable to spawn isolate: pigeons/message.dart: Error: A library can't opt out of null safety by default, when using sound null safety.
    Error: Cannot run with sound null safety, because the following dependencies
    don't support null safety:

    • package:pigeon
    • package:args

    For solutions, see https://dart.dev/go/unsound-null-safety
    Instance of '_StringStackTrace'pub finished with exit code 255

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel master, 1.24.0-8.0.pre.304, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en-CN)
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
    [✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
    Download at: https://developer.apple.com/xcode/download/
    Or install Xcode via the App Store.
    Once installed, run:
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
    CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
    Without CocoaPods, plugins will not work on iOS or macOS.
    For more info, see https://flutter.dev/platform-plugins
    To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
    [✓] Android Studio
    [✓] Android Studio (version 4.1)
    [✓] Android Studio (version 4.0)
    [✓] IntelliJ IDEA Community Edition (version 2020.2.3)
    [✓] VS Code (version 1.51.1)
    [✓] Connected device (1 available)

  5. mitchross commented on Nov 23, 2020

    @mitchross

    Same as @belinwu

    cc @gaaclarke

  6. alr2413 commented on Nov 25, 2020

    @alr2413

    i get the same exception message.
    cc @gaaclarke

  7. gaaclarke commented on Nov 30, 2020

    @gaaclarke
    Member

    Version 0.1.16 published with a fix. This is still a blindspot for Pigeon's CI unfortunately since it requires unstable versions of Dart. I think it will sort itself out once NNDB hits stable.

  8. github-actions commented on Aug 9, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions