error when depoloy flutter project with CodeMagic - flutter
i have an flutter project and it is run good on emulator and my android device, but when i upload it to Github and make (commit) show me this error to review:
i cannot do anything about this error, and it is not affect my project when run it?
and when i ignore it and deploy to GitHub and try to build and deploy project with CodeMagic, i faced this error in (Running Test) step :
== Testing ==
== flutter test --machine ==
{"protocolVersion":"0.1.1","runnerVersion":null,"pid":2836,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"/Users/greenhouse/clone/test/widget_test.dart"},"type":"suite","time":1}
{"test":{"id":1,"name":"loading /Users/greenhouse/clone/test/widget_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":2}
{"count":1,"type":"allSuites","time":10}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":1,"line":null,"column":null,"url":null},"type":"group","time":9907}
{"test":{"id":3,"name":"Counter increments smoke test","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null},"line":76,"column":3,"url":"package:flutter_test/src/widget_tester.dart","root_line":14,"root_column":3,"root_url":"file:///Users/greenhouse/clone/test/widget_test.dart"},"type":"testStart","time":9909}
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":9916}
{"testID":3,"messageType":"print","message":"══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════","type":"print","time":10433}
{"testID":3,"messageType":"print","message":"The following assertion was thrown building MisSplash(state: _OneState#0408f(ticker active)):\nMediaQuery.of() called with a context that does not contain a MediaQuery.\nNo MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of().\nThis can happen because you do not have a WidgetsApp or MaterialApp widget (those widgets introduce\na MediaQuery), or it can happen if the context you use comes from a widget above those widgets.\nThe context used was:\n Scaffold(dirty, state: ScaffoldState#1ae2e(lifecycle state: initialized, tickers: tracking 1\n ticker))","type":"print","time":10438}
{"testID":3,"messageType":"print","message":"\nWhen the exception was thrown, this was the stack:","type":"print","time":10439}
{"testID":3,"messageType":"print","message":"#0 MediaQuery.of (package:flutter/src/widgets/media_query.dart:528:5)","type":"print","time":10450}
{"testID":3,"messageType":"print","message":"#1 ScaffoldState.didChangeDependencies (package:flutter/src/material/scaffold.dart:1529:50)","type":"print","time":10451}
{"testID":3,"messageType":"print","message":"#2 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3862:12)","type":"print","time":10451}
{"testID":3,"messageType":"print","message":"#3 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)","type":"print","time":10452}
{"testID":3,"messageType":"print","message":"#4 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)","type":"print","time":10453}
{"testID":3,"messageType":"print","message":"#5 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)","type":"print","time":10453}
{"testID":3,"messageType":"print","message":"#6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)","type":"print","time":10453}
{"testID":3,"messageType":"print","message":"#7 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)","type":"print","time":10453}
{"testID":3,"messageType":"print","message":"#8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)","type":"print","time":10454}
{"testID":3,"messageType":"print","message":"#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)","type":"print","time":10454}
{"testID":3,"messageType":"print","message":"#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)","type":"print","time":10455}
{"testID":3,"messageType":"print","message":"#11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)","type":"print","time":10455}
{"testID":3,"messageType":"print","message":"#12 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)","type":"print","time":10456}
{"testID":3,"messageType":"print","message":"#13 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:933:16)","type":"print","time":10456}
{"testID":3,"messageType":"print","message":"#14 RenderObjectToWidgetElement.update (package:flutter/src/widgets/binding.dart:911:5)","type":"print","time":10457}
{"testID":3,"messageType":"print","message":"#15 RenderObjectToWidgetElement.performRebuild (package:flutter/src/widgets/binding.dart:925:7)","type":"print","time":10458}
{"testID":3,"messageType":"print","message":"#16 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)","type":"print","time":10458}
{"testID":3,"messageType":"print","message":"#17 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273:33)","type":"print","time":10459}
{"testID":3,"messageType":"print","message":"#18 AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:805:18)","type":"print","time":10460}
{"testID":3,"messageType":"print","message":"#19 _TestWidgetsFlutterBinding&BindingBase&ServicesBinding&SchedulerBinding&GestureBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:268:5)","type":"print","time":10461}
{"testID":3,"messageType":"print","message":"#20 _TestWidgetsFlutterBinding&BindingBase&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:988:15)","type":"print","time":10462}
{"testID":3,"messageType":"print","message":"#21 _TestWidgetsFlutterBinding&BindingBase&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:928:9)","type":"print","time":10462}
{"testID":3,"messageType":"print","message":"#22 AutomatedTestWidgetsFlutterBinding.pump.<anonymous closure> (package:flutter_test/src/binding.dart:719:9)","type":"print","time":10463}
{"testID":3,"messageType":"print","message":"#25 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:69:41)","type":"print","time":10465}
{"testID":3,"messageType":"print","message":"#26 AutomatedTestWidgetsFlutterBinding.pump (package:flutter_test/src/binding.dart:706:27)","type":"print","time":10465}
{"testID":3,"messageType":"print","message":"#27 WidgetTester.pumpWidget.<anonymous closure> (package:flutter_test/src/widget_tester.dart:250:22)","type":"print","time":10465}
{"testID":3,"messageType":"print","message":"#30 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:69:41)","type":"print","time":10466}
{"testID":3,"messageType":"print","message":"#31 WidgetTester.pumpWidget (package:flutter_test/src/widget_tester.dart:247:27)","type":"print","time":10466}
{"testID":3,"messageType":"print","message":"#32 main.<anonymous closure> (file:///Users/greenhouse/clone/test/widget_test.dart:16:18)","type":"print","time":10467}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10467}
{"testID":3,"messageType":"print","message":"#33 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:82:23)","type":"print","time":10468}
{"testID":3,"messageType":"print","message":"#34 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:571:19)","type":"print","time":10469}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10469}
{"testID":3,"messageType":"print","message":"#37 TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:555:14)","type":"print","time":10470}
{"testID":3,"messageType":"print","message":"#38 AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:898:24)","type":"print","time":10472}
{"testID":3,"messageType":"print","message":"#44 AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:895:15)","type":"print","time":10473}
{"testID":3,"messageType":"print","message":"#45 testWidgets.<anonymous closure> (package:flutter_test/src/widget_tester.dart:81:22)","type":"print","time":10473}
{"testID":3,"messageType":"print","message":"#46 Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:168:27)","type":"print","time":10474}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10474}
{"testID":3,"messageType":"print","message":"#47 Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:250:15)","type":"print","time":10475}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10479}
{"testID":3,"messageType":"print","message":"#52 Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:247:5)","type":"print","time":10479}
{"testID":3,"messageType":"print","message":"#53 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:166:33)","type":"print","time":10479}
{"testID":3,"messageType":"print","message":"#58 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:165:13)","type":"print","time":10480}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10480}
{"testID":3,"messageType":"print","message":"#59 Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:400:25)","type":"print","time":10482}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10482}
{"testID":3,"messageType":"print","message":"#73 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)","type":"print","time":10483}
{"testID":3,"messageType":"print","message":"#74 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)","type":"print","time":10483}
{"testID":3,"messageType":"print","message":"#75 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)","type":"print","time":10484}
{"testID":3,"messageType":"print","message":"(elided 32 frames from class _FakeAsync, package dart:async, and package stack_trace)","type":"print","time":10485}
{"testID":3,"messageType":"print","message":"════════════════════════════════════════════════════════════════════════════════════════════════════","type":"print","time":10485}
{"testID":3,"messageType":"print","message":"══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════","type":"print","time":10486}
{"testID":3,"messageType":"print","message":"The following TestFailure object was thrown running a test:\n Expected: exactly one matching node in the widget tree\n Actual: ?:<zero widgets with text \"0\" (ignoring offstage widgets)>\n Which: means none were found but one was expected","type":"print","time":10487}
{"testID":3,"messageType":"print","message":"\nWhen the exception was thrown, this was the stack:","type":"print","time":10489}
{"testID":3,"messageType":"print","message":"#4 main.<anonymous closure> (file:///Users/greenhouse/clone/test/widget_test.dart:19:5)","type":"print","time":10490}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10493}
{"testID":3,"messageType":"print","message":"#5 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:82:23)","type":"print","time":10493}
{"testID":3,"messageType":"print","message":"#6 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:571:19)","type":"print","time":10493}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10498}
{"testID":3,"messageType":"print","message":"#9 TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:555:14)","type":"print","time":10498}
{"testID":3,"messageType":"print","message":"#10 AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:898:24)","type":"print","time":10498}
{"testID":3,"messageType":"print","message":"#16 AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:895:15)","type":"print","time":10498}
{"testID":3,"messageType":"print","message":"#17 testWidgets.<anonymous closure> (package:flutter_test/src/widget_tester.dart:81:22)","type":"print","time":10498}
{"testID":3,"messageType":"print","message":"#18 Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:168:27)","type":"print","time":10499}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10499}
{"testID":3,"messageType":"print","message":"#19 Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:250:15)","type":"print","time":10499}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10499}
{"testID":3,"messageType":"print","message":"#24 Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:247:5)","type":"print","time":10499}
{"testID":3,"messageType":"print","message":"#25 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:166:33)","type":"print","time":10500}
{"testID":3,"messageType":"print","message":"#30 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:165:13)","type":"print","time":10500}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10500}
{"testID":3,"messageType":"print","message":"#31 Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:400:25)","type":"print","time":10501}
{"testID":3,"messageType":"print","message":"<asynchronous suspension>","type":"print","time":10501}
{"testID":3,"messageType":"print","message":"#45 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)","type":"print","time":10501}
{"testID":3,"messageType":"print","message":"#46 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)","type":"print","time":10501}
{"testID":3,"messageType":"print","message":"#47 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)","type":"print","time":10502}
{"testID":3,"messageType":"print","message":"(elided 28 frames from class _FakeAsync, package dart:async, and package stack_trace)","type":"print","time":10502}
{"testID":3,"messageType":"print","message":"\nThis was caught by the test expectation on the following line:\n file:///Users/greenhouse/clone/test/widget_test.dart line 19\n\nThe test description was:\nCounter increments smoke test","type":"print","time":10504}
{"testID":3,"messageType":"print","message":"════════════════════════════════════════════════════════════════════════════════════════════════════","type":"print","time":10505}
{"testID":3,"messageType":"print","message":"══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════","type":"print","time":10505}
{"testID":3,"messageType":"print","message":"The following message was thrown:\nMultiple exceptions (2) were detected during the running of the current test, and at least one was\nunexpected.","type":"print","time":10506}
{"testID":3,"messageType":"print","message":"════════════════════════════════════════════════════════════════════════════════════════════════════","type":"print","time":10507}
{"testID":3,"error":"Test failed. See exception logs above.\nThe test description was: Counter increments smoke test","stackTrace":"","isFailure":false,"type":"error","time":10518}
{"testID":3,"result":"error","skipped":false,"hidden":false,"type":"testDone","time":10521}
{"success":false,"type":"done","time":10560}
Tests failed :|
Flutter test run failed
== Tests failed, skip build ==
there is no error when i run the project? how can find the bugs?, and i try to read this log above, but i cannot understand the error?
Just Disable the test phase, this might work.
Go to the workflow settings then to Test
then uncheck both option for Run "Flutter test" and Stop the "Build if test Fails"
Save it and try again.
Hope it'll solve but you cannot test your app that's the drawback.
Related
How to initialize ScreenUtil.init() in flutter test?
For the BMI app created in flutter, I am writing a test, so when I run the test I am getting this below error: ═╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═ The following assertion was thrown building home_screen(dirty, state: _home_screenState#60944): Ensure to initialize ScreenUtil before accessing it. Please execute the init method : ScreenUtil.init() 'package:flutter_screenutil/screen_util.dart': Failed assertion: line 32 pos 7: '_instance != null' The relevant error-causing widget was: home_screen file:///C:/Users/bmi/test/test.dart:14:32 When the exception was thrown, this was the stack: #2 new ScreenUtil (package:flutter_screenutil/screen_util.dart:32:7) #3 _home_screenState.build (package:bmi/ui_screen/HomeScreen.dart:54:22) #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27) #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15) #6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4667:11) #7 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5) #8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4474:5) #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4658:11) #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4469:5) #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3541:14) #12 Element.updateChild (package:flutter/src/widgets/framework.dart:3303:20) #13 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1182:16) #14 RenderObjectToWidgetElement.update (package:flutter/src/widgets/binding.dart:1160:5) #15 RenderObjectToWidgetElement.performRebuild (package:flutter/src/widgets/binding.dart:1174:7) #16 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5) #17 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2694:33) #18 AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:1102:19) #19 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5) #20 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15) #21 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9) #22 AutomatedTestWidgetsFlutterBinding.pump.<anonymous closure> (package:flutter_test/src/binding.dart:969:9) #25 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:72:41) #26 AutomatedTestWidgetsFlutterBinding.pump (package:flutter_test/src/binding.dart:956:27) #27 WidgetTester.pumpWidget.<anonymous closure> (package:flutter_test/src/widget_tester.dart:522:22) #30 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:72:41) #31 WidgetTester.pumpWidget (package:flutter_test/src/widget_tester.dart:519:27) #32 main.<anonymous closure> (file:///C:/Users/bmi/test/test.dart:14:21) #33 main.<anonymous closure> (file:///C:/Users/bmi/test/test.dart:12:32) #34 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:144:29) <asynchronous suspension> <asynchronous suspension> (elided 7 frames from class _AssertionError, dart:async, and package:stack_trace) ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞══ The following TestFailure object was thrown running a test: Expected: exactly 2 matching nodes in the widget tree Actual: _WidgetTypeFinder:<zero widgets with type "GestureDetector" (ignoring offstage widgets)> Which: means none were found but some were expected When the exception was thrown, this was the stack: #4 main.<anonymous closure> (file:///C:/Users/bmi/test/test.dart:17:5) <asynchronous suspension> <asynchronous suspension> (elided one frame from package:stack_trace) ... This was caught by the test expectation on the following line: file:///C:/Users/bmi/test/test.dart line 17 The test description was: age increment ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞══ The following message was thrown: Multiple exceptions (2) were detected during the running of the current test, and at least one was unexpected. Test failed. See exception logs above. The test description was: age increment This is my flutter test code: import 'package:bmi_app_one/ui_screen/HomeScreen.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main(){ TestWidgetsFlutterBinding.ensureInitialized(); testWidgets('age increment', (WidgetTester ageTester) async { await ageTester.pumpWidget(home_screen()); // To verify that age counter starts at 20 expect(find.byType(GestureDetector), findsNWidgets(2)); expect(find.text('0'), findsNothing); }); } I tried to initialize it like this but got the same error: setUpAll(() async{ TestWidgetsFlutterBinding.ensureInitialized(); await ScreenUtilInit(); }); tried googling it but couldn't find how to initialize ScreenUtil() in the flutter test. Any help would be appreciated.
I faced the same issue, all what I did is that, wrap your home_screen with ScreenUtilInit: await tester.pumpWidget( MaterialApp( home: ScreenUtilInit( designSize: Size(360, 690), allowFontScaling: false, child: home_screen(), )), );
Flutter cannot be apgraded anymore
After downloading the flutter archive and installing on macbook, everything works fine, but once I typed the flutter upgrade command the process failed and I got the error below. Unhandled exception: Invalid argument(s): Cannot find executable for sysctl. #0 _getExecutable (package:process/src/interface/local_process_manager.dart:124:5) #1 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:91:30) #2 ErrorHandlingProcessManager.runSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:649:37) #3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:548:14) #4 ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:649:12) #5 _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:420:51) #6 _MacOSUtils.hostPlatform (package:flutter_tools/src/base/os.dart:305:25) #7 _MacOSUtils.name (package:flutter_tools/src/base/os.dart:291:123) #8 new _DefaultUsage (package:flutter_tools/src/reporting/usage.dart:247:18) #9 new Usage (package:flutter_tools/src/reporting/usage.dart:81:9) #10 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:263:20) #11 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:41) #12 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23) #13 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20) #14 AppContext.get (package:flutter_tools/src/base/context.dart:121:32) #15 flutterUsage (package:flutter_tools/src/globals.dart:55:35) #16 _handleToolError (package:flutter_tools/runner.dart:133:13) #17 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:87:13) #18 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:81:17) #19 _rootRunBinary (dart:async/zone.dart:1222:13) #20 _CustomZone.runBinary (dart:async/zone.dart:1107:19) #21 runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1601:18) #22 _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19) #23 Future._propagateToListeners (dart:async/future_impl.dart:646:16) #24 Future._completeError (dart:async/future_impl.dart:537:5) #25 _completeOnAsyncError (dart:async-patch/async_patch.dart:264:13) #26 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart) <asynchronous suspension> Please can someone help me?
I had a thing where each call of "flutter" executable did nothing and just returned without output. remove the flutter sdk and install it fresh, helped in my case.
Flutter Installation failed
Steps to Reproduce follow https://flutter.dev/docs/get-started/install/windows git clone -b stable https://github.com/flutter/flutter.git updated my Edit environment variables Logs C:\Users\Win10>flutter doctor CreateProcessW failed 193 CreateProcessW failed 193 CreateProcessW failed 193 Unhandled exception: ProcessException: %1 is not a valid Win32 application. Command: C:\Program Files\Git\cmd\git.EXE log -n 1 --pretty=format:%H #0 _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:489:7) #1 _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:634:18) #2 Process.runSync (dart:io-patch/process_patch.dart:66:12) #3 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83:20) #4 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:343:48) #5 runSync (package:flutter_tools/src/base/process.dart:315:10) #6 _runGit (package:flutter_tools/src/version.dart:532:10) #7 new FlutterVersion (package:flutter_tools/src/version.dart:23:26) #8 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:81:29) #9 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41) #10 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23) #11 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20) #12 AppContext.get (package:flutter_tools/src/base/context.dart:115:32) #13 FlutterVersion.instance (package:flutter_tools/src/version.dart:183:49) #14 new Usage (package:flutter_tools/src/usage.dart:60:58) #15 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:101:20) #16 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41) #17 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23) #18 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20) #19 AppContext.get (package:flutter_tools/src/base/context.dart:115:32) #20 Usage.instance (package:flutter_tools/src/usage.dart:84:40) #21 flutterUsage (package:flutter_tools/src/usage.dart:54:33) #22 _handleToolError (package:flutter_tools/runner.dart:112:7) <asynchronous suspension> #23 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:69:13) <asynchronous suspension> #24 _rootRunBinary (dart:async/zone.dart:1148:13) #25 _CustomZone.runBinary (dart:async/zone.dart:1037:19) #26 runZoned.<anonymous closure> (dart:async/zone.dart:1479:21) #27 _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19) #28 Future._propagateToListeners (dart:async/future_impl.dart:589:16) #29 Future._completeError (dart:async/future_impl.dart:491:5) #30 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12) #31 _Completer.completeError (dart:async/future_impl.dart:27:5) #32 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:40:18) #33 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart) <asynchronous suspension> #34 _rootRun (dart:async/zone.dart:1124:13) #35 _CustomZone.run (dart:async/zone.dart:1021:19) #36 _runZoned (dart:async/zone.dart:1516:10) #37 runZoned (dart:async/zone.dart:1500:12) #38 run.<anonymous closure> (package:flutter_tools/runner.dart:60:18) <asynchronous suspension> #39 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29) <asynchronous suspension> #40 _rootRun (dart:async/zone.dart:1124:13) #41 _CustomZone.run (dart:async/zone.dart:1021:19) #42 _runZoned (dart:async/zone.dart:1516:10) #43 runZoned (dart:async/zone.dart:1463:12) #44 AppContext.run (package:flutter_tools/src/base/context.dart:152:18) <asynchronous suspension> #45 runInContext (package:flutter_tools/src/context_runner.dart:56:24) <asynchronous suspension> #46 run (package:flutter_tools/runner.dart:51:10) #47 main (package:flutter_tools/executable.dart:62:9) <asynchronous suspension> #48 main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3) #49 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32) #50 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12) Found https://github.com/flutter/flutter/issues/19805#issuecomment-478306166 and Flutter with installation error for %1 is not a valid win32 application, but I have follow what those research say , but none of those help
It seems you have not pasted the PATH in Environment Variables Account. You have to take the flutter(Extracted folder), and paste the path upto flutter/bin in the Edit Path table. then try running flutter doctor from the folder(in terminal) where you have your flutter folder
How should use flutter_web_test package to run unit test on flutter_web project?
I have been exploring the flutter web for a while, everything is fine. But I have problems in creating unit test (StatelessWidget test for example) for flutter_web components. I have discover that there is a packages called flutter_web_test but it seems didn't work well. test code as follow: I have install test packages used by flutter_web demo projects: flutter_web_test // import fluter import 'package:flutter_web_test/flutter_web_test.dart'; // a stateless widget is imported import 'package:ies2.pms/views/main.dart'; void main() { testWidgets( 'test whether ', (WidgetTester tester) async { // very simple code, create widget in test await tester.pumpWidget(CYFCustomView(name: 'aaa')); print('aaa'); }, ); } Then I start running with flutter test Then I have received following errors: Failed to load test harness. Are you missing a dependency on flutter_test? 00:05 +0: loading /Users/yifan.chen/ByteDanceIES/pms/test/main_test.dart Unhandled exception: FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Aflutter_test%2Fflutter_test.dart; message=StandardFileSystem only supports file:* and data:* URIs) #0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7) #1 asFileUri (package:vm/kernel_front_end.dart:601:37) <asynchronous suspension> #2 FrontendCompiler._outputDependenciesDelta (package:vm/frontend_server.dart:401:39) <asynchronous suspension> #3 FrontendCompiler.compile (package:vm/frontend_server.dart:375:13) <asynchronous suspension> #4 _FlutterFrontendCompiler.compile (package:frontend_server/server.dart:31:22) <asynchronous suspension> #5 listenAndCompile.<anonymous closure> (package:vm/frontend_server.dart:736:26) <asynchronous suspension> #6 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10) #7 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11) #8 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7) #9 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11) #10 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11) #11 _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11) #12 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:150:13) #13 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:125:5) #14 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5) #15 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24) #16 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10) #17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11) #18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7) #19 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11) #20 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11) #21 _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11) #22 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:241:7) #23 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:312:20) #24 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:305:5) #25 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18) #26 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24) #27 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10) #28 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11) #29 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7) #30 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19) #31 _StreamController._add (dart:async/stream_controller.dart:640:7) #32 _StreamController.add (dart:async/stream_controller.dart:586:5) #33 _Socket._onData (dart:io-patch/socket_patch.dart:1786:41) #34 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10) #35 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11) #36 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7) #37 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19) #38 _StreamController._add (dart:async/stream_controller.dart:640:7) #39 _StreamController.add (dart:async/stream_controller.dart:586:5) #40 new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1335:33) #41 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:856:14) #42 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) #43 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5) #44 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13) #45 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5) 00:05 +0 -1: loading /Users/yifan.chen/ByteDanceIES/pms/test/main_test.dart [E] I can't find any solutions in Stackoverflow. And flutter_web currently haven't open issues yet. I have only discovered an issue in flutter, saying that flutter test is not supported for flutter_web project. How should I run unit test on flutter_web project ? They have built flutter_web_test package, so it is supposed to be functional.
you shoukd move to flutter 1.9, flutter_web is deprecrated https://flutter.dev/web, the shorter way is update flutter to 1.9, create a new fresh project and activate web on it: flutter run -d chrome now you can build with flutter build web. I hope it solves your problems.
flutter doctor throwing Unhandled exception on Mac OS X 10.14.3
Everything works fine except the flutter doctor command I really don't know what it could be. Any help? Command flutter doctor Exception Victors-MacBook-Pro:police_videos victoraldir$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.3 18D109, locale en-IE) ⣽Unhandled exception: RangeError (index): Invalid value: Only valid value is 0: 1 #0 List.[] (dart:core/runtime/libgrowable_array.dart:145:60) #1 IntelliJValidatorOnMac.pluginsPath (package:flutter_tools/src/doctor.dart:681:31) #2 IntelliJValidator.validate (package:flutter_tools/src/doctor.dart:524:53) <asynchronous suspension> #3 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:116:52) #4 Doctor.diagnose (package:flutter_tools/src/doctor.dart:189:41) #5 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6) #6 Doctor.diagnose (package:flutter_tools/src/doctor.dart:179:24) #7 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:48:39) #8 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6) #9 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:34:42) #10 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:545:18) #11 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64) #12 _rootRunUnary (dart:async/zone.dart:1132:38) #13 _CustomZone.runUnary (dart:async/zone.dart:1029:19) #14 _FutureListener.handleValue (dart:async/future_impl.dart:126:18) #15 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45) #16 Future._propagateToListeners (dart:async/future_impl.dart:668:32) #17 Future._complete (dart:async/future_impl.dart:473:7) #18 _SyncCompleter.complete (dart:async/future_impl.dart:51:12) #19 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20) #20 _rootRun (dart:async/zone.dart:1124:13) #21 _CustomZone.run (dart:async/zone.dart:1021:19) #22 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23) #23 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) #24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5) #25 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13) #26 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
Turns out that I had a corrupted installation of IntelliJ (not Android Studio) hanging in my environment. Removed it completely and the problem has gone away