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

example app crashes #23

Closed
garyloud opened this issue Mar 6, 2018 · 4 comments
Closed

example app crashes #23

garyloud opened this issue Mar 6, 2018 · 4 comments

Comments

@garyloud
Copy link

garyloud commented Mar 6, 2018

I'm sure I'm doing something wrong but the example app crashes.
This is using Android Studio targeting iOS using the simulator. I also got the same results when targeting my iPhone.
XXXXX below is really ("latitude"). When I included it along with the [] the preview blanked it out.
I'm just starting with Flutter so I'm sure this is an error on my part but a google search has turned up nothing. The following was copied from the console.

Launching lib/main.dart on iPad Air in debug mode...
Running Xcode clean...
Starting Xcode build...
Xcode build done
Syncing files to device iPad Air...
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building MyApp(dirty, state: _MyAppState#5aec3):
The method '[]' was called on null.
Receiver: null
Tried calling:[]XXXXX

When the exception was thrown, this was the stack:
#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1 _MyAppState.build (/Users/garyloudermilk/AndroidStudioProjects/flutter_app/lib/main.dart:64:107)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:3713:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3625:15)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3741:22)
#7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#9 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#10 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:852:16)
#11 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:823:5)
#12 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:769:17)
#13 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2205:19)
#14 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:768:13)
#15 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:657:7)
#16 runApp (package:flutter/src/widgets/binding.dart:699:7)
#17 main (/Users/garyloudermilk/AndroidStudioProjects/flutter_app/lib/main.dart:7:3)
#18 _startIsolate. (dart:isolate-patch/dart:isolate/isolate_patch.dart:279)
#19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
════════════════════════════════════════════════════════════════════════════════════════════════════
*** First throw call stack:
(
0 CoreFoundation 0x0000000106a3712b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001060cbf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000106aac245 +[NSException raise:format:] + 197
3 Runner 0x00000001042ce5e5 -[LocationPlugin handleMethodCall:result:] + 789
4 Flutter 0x00000001043a2785 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 118
5 Flutter 0x00000001043b8d53 _ZN5shell15PlatformViewIOS21HandlePlatformMessageEN3fxl6RefPtrIN5blink15PlatformMessageEEE + 189
6 Flutter 0x00000001043e12af _ZNSt3__110<…>
Lost connection to device.

@clemens-tolboom
Copy link

clemens-tolboom commented Mar 14, 2018

I just checked out this repo then

cd examples
flutter packages get
flutter run

and got the same stacktrace which is caused by location permissions not given yet. I got the Allow location permissions dialog in the app on the simulator. Next I saw lon/lat data.

  • After Hardware restart starting the app it crashed.
  • Checking the permissions for the app these were set OK. Restarting the App I got lon/lat again.

I guess this is a timing problem somehow?

@Tom1827
Copy link

Tom1827 commented Mar 19, 2018

Same for me as @garyloud. Followed the install instructions, copy/paste the exact example code, and:

`══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building MyApp(dirty, state: _MyAppState#01986):
The method '[]' was called on null.
Receiver: null
Tried calling:

When the exception was thrown, this was the stack:
#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1 _MyAppState.build (/Users/tom/Google Drive/prog/flutter/gps_test/lib/main.dart:64:107)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:3690:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3602:15)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:3463:5)
#5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3582:5)
#6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3718:22)
#7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3577:5)
#8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2875:14)
#9 Element.updateChild (package:flutter/src/widgets/framework.dart:2678:12)
#10 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:852:16)
#11 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:823:5)
#12 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:769:17)
#13 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2190:19)
#14 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:768:13)
#15 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:657:7)
#16 runApp (package:flutter/src/widgets/binding.dart:699:7)
#17 main (/Users/tom/Google Drive/prog/flutter/gps_test/lib/main.dart:7:3)
#18 _startIsolate. (dart:isolate-patch/dart:isolate/isolate_patch.dart:278)
#19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:164)
════════════════════════════════════════════════════════════════════════════════════════════════════
*** First throw call stack:
(
0 CoreFoundation 0x00000001096ca12b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000108d5ef41 objc_exception_throw + 48
2 CoreFoundation 0x000000010973f245 +[NSException raise:format:] + 197
3 Runner 0x0000000106f385e5 -[LocationPlugin handleMethodCall:result:] + 789
4 Flutter 0x000000010700b880 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 118
5 Flutter 0x0000000107020583 _ZN5shell15PlatformViewIOS21HandlePlatformMessageEN3fxl6RefPtrIN5blink15PlatformMessageEEE + 189
6 Flutter 0x0000000107048e93 _ZNSt3__110<…>`

@clemens-tolboom
Copy link

@Tom1827 why paste the same info again into the issue? Please try to add new info :-)

@Lyokone
Copy link
Owner

Lyokone commented May 30, 2018

This should be fixed with the new version, feel free to open again if it's not.

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

4 participants