我在日志中收到此消息,尽管一切正常
W/Parcel: Expecting binder but got null!
有人遇到过这样的问题吗?如何解决?
重现步骤:
预期行为:
跑步日志
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
Debug service listening on ws://127.0.0.1:62931/5G0AlEiF5bQ=/ws
Syncing files to device sdk gphone64 x86 64...
I/.flutter_issues(17884): Compiler allocated 4533KB to compile void android.view.ViewRootImpl.performTraversals()
E/SurfaceSyncer(17884): Failed to find sync for id=0
W/Parcel (17884): Expecting binder but got null!
尝试在
main()
函数中添加以下行
WidgetsFlutterBinding.ensureInitialized();
如果这不起作用,请检查您传递给
initialBinding:
中的 MaterialApp()
的值是否不为空。
字面意思
文件 -> 使缓存无效 -> 清除文件系统缓存
然后重建为我修复了它(React Native 0.68.2)
该消息实际上不会影响应用程序的功能。但您仍然可以在
main()
中添加一行。在主函数中添加WidgetsFlutterBinding.ensureInitialized();
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
如果之前工作正常,请停止并重新启动模拟器。它对我有用。
我有 super.build();无缘无故地在我的小部件中。只是忘记删除代码了。所以我删除了代码并修复了。
class _VehicleAddState extends State<VehicleAdd>
with AutomaticKeepAliveClientMixin<VehicleAdd> {
double selectedMenu = 0;
@override
Widget build(BuildContext context) {
super.build(context);