Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Build failed on SchedulerBinding.instance.addPostFrameCallback((_) #606

Closed
spokV opened this issue Feb 17, 2022 · 3 comments
Closed

Build failed on SchedulerBinding.instance.addPostFrameCallback((_) #606

spokV opened this issue Feb 17, 2022 · 3 comments

Comments

@spokV
Copy link

spokV commented Feb 17, 2022

Hi
Just cloned the latest master and perform build on linux machine (fedora 35) using sdk 2.10.1, and I get the following result:

lib/feature_discovery/feature_discovery.dart:224:35: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?'
because it is potentially null.
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart'
('../flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback(() {
^^^^^^^^^^^^^^^^^^^^
lib/feature_discovery/feature_discovery.dart:240:37: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?'
because it is potentially null.
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart'
('../flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback((
) {
^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception
Failed to build bundle.

I can fix the issue by apply the suggested fix in build output text but was thinking if it can cause other issues on run time..

Best Regards

@amanv8060
Copy link
Contributor

Hi,
Thanks for filing issue.
Gallery is currently configured to build against the master channel of flutter.

Discussion regarding making it run with beta/stable is ongoing here.

cc/ @guidezpl

@amanv8060
Copy link
Contributor

@guidezpl can this be closed?

@guidezpl
Copy link
Member

Yes.

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

No branches or pull requests

3 participants