Repository navigation
【pigeon】Error: This project cannot run with sound null safety, because one or more project dependencies do not #70355
Description
Activity
I will consider this as proposal since as far as I know Pigeon is not migrated to null-safety yet.
- addedpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.p: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutter
on Nov 12, 2020 Looks like
Isolate.spawnUriis 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.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.
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 255Doctor 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)Reacted by Mitch Ross and gaaclarkeSame as @belinwu
cc @gaaclarke
i get the same exception message.
cc @gaaclarkeVersion 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.
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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Aug 9, 2021
When I run bash:
I get this error:
Here is my
pubspec.yaml:and flutter version