Skip to content

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

Closed

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

Activity

  1. TahaTesser commented on Jul 17, 2020

    @TahaTesser
    Contributor

    Hi @jaysephjw
    Could you please upgrade pigeon to latest pigeon 0.1.2+1 and try again?
    Thank you

  2. added
    in triagePresently being triaged by the triage team
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 17, 2020
  3. jaysephjw commented on Jul 17, 2020

    @jaysephjw
    Author

    Hey @TahaTesser.

    Just tried, still reproduces on 0.1.2+1.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 17, 2020
  5. added
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    and removed
    in triagePresently being triaged by the triage team
    on Jul 20, 2020
  6. jaysephjw commented on Jul 29, 2020

    @jaysephjw
    Author

    @gaaclarke any ideas?

  7. gaaclarke commented on Jul 29, 2020

    @gaaclarke
    Member

    Yep, reproduced it. It was an oversight, let me address it quickly. Looks like Map shouldn't work either.

  8. gaaclarke commented on Jul 29, 2020

    @gaaclarke
    Member

    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.

  9. github-actions commented on Aug 18, 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.

  10. locked as resolved and limited conversation to collaborators on Aug 18, 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

    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