Repository navigation
pigeon: missing required import in autogenerated .dart #64806
Description
Activity
Please provide the results to
flutter doctor -v- addedp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen tool
on Aug 28, 2020 Please provide the results to
flutter doctor -vOK, thank you for prompt response! But generally speaking, this is a very evident issue regardless of actual configuration. That's why I've omitted extra unrelated details.
[✓] Flutter (Channel master, 1.22.0-2.0.pre.106, on Mac OS X 10.15.6 19G2021, locale en-UA) • Flutter version 1.22.0-2.0.pre.106 at /Users/apc/Library/flutter • Framework revision 2ae25cc2d7 (2 hours ago), 2020-08-28 09:00:53 -0700 • Engine revision 77dd1c05b9 • Dart version 2.10.0 (build 2.10.0-67.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/apc/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/apc/Library/Android/sdk • ANDROID_SDK_ROOT = /Users/apc/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✗] 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: sudo gem install cocoapods [✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 48.1.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] Connected device (2 available) • Nexus 10 (mobile) • R32D100K5GE • android-arm • Android 5.1.1 (API 22) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)Thanks, I'll have to look into this. It isn't immediately clear to me what is happening in your setup. We have a number of integration tests that don't experience this problem. There must be something different about your setup. Ideally I find out the root cause before addressing it.
The thing is that as soon as I add import 'dart:typed_data' into generated file, everything works immediately like a charm.
Even in a pigeon file this import is required before generation, otherwise Uint8List is underlined with error:import 'dart:typed_data'; import 'package:pigeon/pigeon_lib.dart'; class ProductInfo { Uint8List pngIcon; double pngIconSize; String applicationName; String applicationVersion; }I've faced this issue too. I also use Uint8List in my request class field
- addedpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
on Aug 31, 2020 fixed in 0.1.5
Reacted by arsenioo and fzyzcjyThis 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 12, 2021
@gaaclarke
Steps to Reproduce
Expected results:
Successful compilation, no need to edit auto generated .dart file
Actual results:
Auto generated dart compilation error due to missing import 'dart:typed_data'