I am trying to run my flutter app in VS CODE using the iOS simulator, but run into this error everything I try to run it.
code's output:
↳
Writing result bundle at path:
/var/folders/sq/dtjqcb_d6dl_fd5h0mrz2v3w0000gn/T/flutter_tools.VfxLC7/flutter_ios_build_temp_dirvSkZM4/temporary_xcresult_bundle
4
Invalid depfile: /Users/ga/Downloads/ca-main/.dart_tool/flutter_build/c223e2b93da92742124a153e03452ae1/kernel_snapshot.d
: Error: Not found: 'dart:js'
../…/lib/js.dart:8
export 'dart:js' show allowInterop, allowInteropCaptureThis;
^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
lib/widgets/place_suggestion_widget.dart:18
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) async{
^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ajs; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)
#1 asFileUri (package:vm/kernel_front_end.dart:652:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:792:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/frontend_server.dart:615:9)
<asynchronous suspension>
#4 starter (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/frontend_server.dart:1433:12)
<asynchronous suspension>
#5 main (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:10:14)
#5 main (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:10:14)
<asynchronous suspension>
Failed to package /Users/ga/Downloads/ca-main.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/ga/Downloads/ca-main/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.5.99. (in target 'abseil' from project 'Pods')
/Users/ga/Downloads/ca-main/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.5.99. (in target 'BoringSSL-GRPC' from project 'Pods')
/var/folders/sq/dtjqcb_d6dl_fd5h0mrz2v3w0000gn/T/flutter_tools.VfxLC7/flutter_ios_build_temp_dirvSkZM4/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPod touch (7th generation).
Exited
the build keeps failing and I cannot figure out why. There ins't much information on this online.
I am first running the iOS emulator, and then running flutter run. This does the running Xcode build
and after about a minute throws this error. Any ideas?
In lib/widgets/place_suggestion_widget.dart:18 try replacing WidgetsBinding.instance!
with WidgetsBinding.instance?.addPostFrameCallback
Also, try doing flutter clean
and flutter pub get
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.