Repository navigation
[pigeon] Exception when trying to use a List type #61660
Copy link
Copy link
Closed
Labels
p: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
Hey! I'm having exceptions when trying to use a List type on version 0.1.0-experimental.11.
Am I doing something wrong? Docs mention Note: Generics for List and Map aren't supported yet but I take that to mean List and Map without type parameters are.
Trying to get this to work for a PR to video_player.
My code:
class TestMessage {
List testList;
}
@HostApi()
abstract class TestApi {
int test(TestMessage msg);
}
void configurePigeon(PigeonOptions opts) {
// Working
opts.dartOut = 'pigeon_out.dart';
// Breaks
opts.objcHeaderOut = 'messages.h';
opts.objcSourceOut = 'messages.m';
// Breaks
opts.javaOut = 'Messages.java';
opts.javaOptions.package = 'com.example';
}
iOS exception:
➜ flutter pub run pigeon --input pigeons/messages.dart
Unhandled exception:
NoSuchMethodError: The getter 'isBuiltin' was called on null.
Receiver: null
Tried calling: isBuiltin
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 generateObjcHeader (package:pigeon/objc_generator.dart:98:48)
#2 Pigeon.run.<anonymous closure> (package:pigeon/pigeon_lib.dart:328:34)
#3 Pigeon._runGenerator (package:pigeon/pigeon_lib.dart:247:9)
#4 Pigeon.run (package:pigeon/pigeon_lib.dart:326:15)
<asynchronous suspension>
#5 main (file:///Users/jwarrick/dev/personal-github/plugins/packages/video_player/video_player/_pigeon_temp_.dart:7:21)
#6 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
pub finished with exit code 255
Android exception:
➜ flutter pub run pigeon --input pigeons/messages.dart
Unhandled exception:
NoSuchMethodError: The getter 'datatype' was called on null.
Receiver: null
Tried calling: datatype
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 generateJava.<anonymous closure>.<anonymous closure> (package:pigeon/java_generator.dart:224:50)
#2 Indent.scoped (package:pigeon/generator_tools.dart:71:9)
#3 generateJava.<anonymous closure> (package:pigeon/java_generator.dart:220:14)
#4 Indent.scoped (package:pigeon/generator_tools.dart:71:9)
#5 generateJava (package:pigeon/java_generator.dart:214:10)
#6 Pigeon.run.<anonymous closure> (package:pigeon/pigeon_lib.dart:341:17)
#7 Pigeon._runGenerator (package:pigeon/pigeon_lib.dart:247:9)
#8 Pigeon.run (package:pigeon/pigeon_lib.dart:338:15)
<asynchronous suspension>
#9 main (file:///Users/jwarrick/dev/personal-github/plugins/packages/video_player/video_player/_pigeon_temp_.dart:7:21)
#10 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
pub finished with exit code 255
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Activity
TahaTesser commentedon Jul 17, 2020
Hi @jaysephjw
Could you please upgrade
pigeonto latestpigeon 0.1.2+1and try again?Thank you
jaysephjw commentedon Jul 17, 2020
Hey @TahaTesser.
Just tried, still reproduces on 0.1.2+1.
jaysephjw commentedon Jul 29, 2020
@gaaclarke any ideas?
gaaclarke commentedon Jul 29, 2020
Yep, reproduced it. It was an oversight, let me address it quickly. Looks like Map shouldn't work either.
gaaclarke commentedon Jul 29, 2020
flutter/packages#186 fixes the list issue.
You are going to run into problem using 'int' in return types, too. I added an error message for that in flutter/packages#185.
github-actions commentedon Aug 18, 2021
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.