Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'String?' is nullable and 'Object' isn't. #67

Open
Peibalam opened this issue Mar 29, 2022 · 7 comments
Open

'String?' is nullable and 'Object' isn't. #67

Peibalam opened this issue Mar 29, 2022 · 7 comments

Comments

@Peibalam
Copy link

../../../.pub-cache/hosted/pub.flutter-io.cn/unpub-2.0.0/lib/src/app.dart:113:48: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.

  • 'Object' is from 'dart:core'.
    var server = await shelf_io.serve(handler, host, port);

dart version:Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "macos_x64"

@LouisShark
Copy link

LouisShark commented Apr 11, 2022

这个问题解决了吗

../../../.pub-cache/hosted/pub.flutter-io.cn/unpub-2.0.0/lib/src/app.dart:113:48: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.

  • 'Object' is from 'dart:core'.
    var server = await shelf_io.serve(handler, host, port);

dart version:Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "macos_x64"

@Peibalam
Copy link
Author

要下载源码修改才行,把String? 改为String

@zeqinjie
Copy link

zeqinjie commented May 3, 2022

要下载源码修改才行,把String? 改为String

@Peibalam 我把 String? 改了 String 还是会,改成 Object 也会~😓是遗漏了哪一步吗?

  • 研发一番发现问题了:我的根项目和 flutter 目录下的 .pub-cache 存在各自的一份 unpub-2.0.0 源码(个人猜测 dart 、 flutter 命令启动服务有关)。这块需要注意 😓

@rdev-software
Copy link

Thats not really helpful

@Peibalam
Copy link
Author

Here's the current workaround, can run after modifying String? to String on

https://github.com/bytedance/unpub/blob/54742c625d5b4820e353e62be298157c830ebc2f/unpub/bin/unpub.dart#L16

&
https://github.com/bytedance/unpub/blob/54742c625d5b4820e353e62be298157c830ebc2f/unpub/lib/src/app.dart#L103

yes,after i modifying Line 103 from String? to String and delete your .pub-cache un-pub cache.

@Dampfwalze
Copy link

There is already a pull request: #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants