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

Uploader seems to crash on iOS #29

Closed
powerspowers opened this issue Jan 2, 2019 · 4 comments
Closed

Uploader seems to crash on iOS #29

powerspowers opened this issue Jan 2, 2019 · 4 comments
Labels
bug Something isn't working iOS Waiting for response

Comments

@powerspowers
Copy link

powerspowers commented Jan 2, 2019

When clicking on the + icon to add an image I get the following on my attached iPhone XR running iOS 12.1

I will work on debugging but I'm rather new to flutter. It looks like it requires waiting for the Uploader object to initialize before building a dependent object.

[VERBOSE-2:shell.cc(184)] Dart Error: Unhandled exception:
inheritFromWidgetOfExactType(_LocalizationsScope) or inheritFromElement() was called before _Uploader.initState() completed.
When an inherited widget changes, for example if the value of Theme.of() changes, its dependent widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor or an initState() method, then the rebuilt dependent widget will not reflect the changes in the inherited widget.
Typically references to to inherited widgets should occur in widget build() methods. Alternatively, initialization based on inherited widgets can be placed in the didChangeDependencies method, which is called after initState and whenever the dependencies change thereafter.
#0      StatefulElement.inheritFromElement.<anonymous closure> (package:flutter/src/widgets/framework.dart:3920:9)
#1      StatefulElement.inheritFromElement (package:flutter/src/widgets/framework.dart:3953:6)
#2      Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3274:14)
#3      Localizations.of (package:flutter/src/widgets/localizations.dart:448:47)
#4      debugCheckHasMaterialLocalizations.<anonymous closure> (package:flutter/src/material/debug.dart:88:23)
#5      debugCheckHasMaterialLocalizations (package:flutter/src/material/debug.dart:127:4)
#6      showDialog (package:flutter/src/material/dialog.dart:635:10)
#7      _Uploader._selectImage (package:Fluttergram/upload_page.dart:143:12)
<asynchronous suspension>
#8      _Uploader.initState (package:Fluttergram/upload_page.dart:34:7)
#9      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3830:58)
#10     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#11     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#13     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#14     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#15     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#16     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#17     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#18     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#19     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#20     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#21     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#22     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#23     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#24     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#25     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
#26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#27     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#28     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#29     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#30     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#31     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#33     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#35     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#36     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#37     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#38     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4047:11)
#39     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#40     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#41     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
#42     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
#43     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
#44     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
#45     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
#46     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
#47     Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
#48     SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1028:36)
#49     SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:1013:20)
#50     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2266:19)
#51     SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1006:11)
#52     RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:274:23)
#53     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1730:58)
#54     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:799:15)
#55     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1730:13)
#56     RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:263:5)
#57     RenderSliverMultiBoxAdaptor.addInitialChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:341:5)
#58     RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:169:12)
#59     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
#60     RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:405:13)
#61     RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1316:12)
#62     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1234:20)
#63     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
#64     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
#65     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
#66     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:677:13)
#67     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
#68     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
#69     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
#70     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
#71     _invoke (dart:ui/hooks.dart:154:13)
#72     _drawFrame (dart:ui/hooks.dart:143:3)
@aenulfi3
Copy link

aenulfi3 commented Apr 9, 2019

yeah it gave me an error after pressing confirm (Tick button) after taking a picture

@mdanics mdanics added bug Something isn't working iOS labels May 20, 2019
@mdanics
Copy link
Owner

mdanics commented Jul 31, 2019

@powerspowers @aenulfi3 I know i'm a little late on this but: I tried to reproduce this on both an iOS simulator and an iPhone 8 running iOS 12.3.2.

Is this something that you guys can still reproduce, if so can you provide some steps for reproducing?

@powerspowers
Copy link
Author

I couldn't figure this out so I had to move on. I think its hard to test on a simulator because iPhone simulator doesn't let you upload photos correct? My stack dump was the last tangible information I had.

Currently I'm testing out the alpha of the Flutter for Web release. Its quite promising although still wobbly. Your example helped me get up to speed so big thank you.

@mdanics
Copy link
Owner

mdanics commented Jul 31, 2019

Yeah simulator didn't let me take photos, so I tried with a real iPhone 8, but it seems to be working. It could have been an old plugin failure that has now been resolved. I'm going to close the issue for now, but i'll keep an eye out

Glad I could help :) Flutter for web is exciting, haven't had a chance to explore it yet, but it would be cool to get a web side to Fluttergram going (if only i had the time haha)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS Waiting for response
Projects
None yet
Development

No branches or pull requests

3 participants