syncfusion / flutter-examples

This repository contains the Syncfusion Flutter UI widgets examples and the guide to use them.
Other
1.98k stars 775 forks source link

IOS build not running {ScrollableState, RenderAbstractViewport} Nullable issue #734

Closed Dev-Muhammad-Junaid closed 1 year ago

Dev-Muhammad-Junaid commented 1 year ago

`Xcode's output: ↳ Writing result bundle at path: /var/folders/lt/n_h7j8jx0sq1lrbrbs0t2qmr0000gn/T/flutter_tools.RE6YOS/flutter_ios_build_temp_dirlNg84u/temporary_xcresult_bundle

../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7596:37: Error: The argument type 'ScrollableState?' can't be assigned to the parameter type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../Development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
        scrollableState: Scrollable.of(context),
                                    ^
../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7611:40: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../Development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
        ..scrollableState = Scrollable.of(context)
                                       ^
../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7665:71: Error: A value of type 'RenderAbstractViewport?' can't be returned from a function with return type 'RenderAbstractViewport' because 'RenderAbstractViewport?' is nullable and 'RenderAbstractViewport' isn't.
 - 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('../../Development/flutter/packages/flutter/lib/src/rendering/viewport.dart').
  RenderAbstractViewport get _stackViewPort => RenderAbstractViewport.of(this);
                                                                      ^
../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_calendar-20.4.48/lib/src/calendar/sfcalendar.dart:10776:71: Error: A value of type 'RenderAbstractViewport?' can't be returned from a function with return type 'RenderAbstractViewport' because 'RenderAbstractViewport?' is nullable and 'RenderAbstractViewport' isn't.
 - 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('../../Development/flutter/packages/flutter/lib/src/rendering/viewport.dart').
  RenderAbstractViewport get _stackViewPort => RenderAbstractViewport.of(this);
                                                                      ^
Failed to package /Users/jd/AndroidStudioProjects/calendar_poc_work.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

Result bundle written to path:
    /var/folders/lt/n_h7j8jx0sq1lrbrbs0t2qmr0000gn/T/flutter_tools.RE6YOS/flutter_ios_build_temp_dirlNg84u/temporary_xcresult_bundle

Could not build the application for the simulator. Error launching application on iPhone 14 Pro Max. `

Dev-Muhammad-Junaid commented 1 year ago

Someone wrote a solution to call dependencies like this dependencies:

syncfusion_flutter_calendar: "20.4.48" syncfusion_flutter_datepicker: "20.4.48"

Instead of

syncfusion_flutter_calendar: ^20.4.48 syncfusion_flutter_datepicker: ^20.4.48

This solution worked for me