Skip to content

[pigeon] Exception when trying to use a List type #61660

@jaysephjw

Description

@jaysephjw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: 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