i am new by Flutter development. I have a problem by build an IOS App.
I have MacBook Air with M1 Chip (Big Sur)
My App works perfectly on Android Simulator, Real Device, Web, iPhone Simualtor, but when I try to build an iOS App, I get the following error:
[ +10 ms] Encountered error while building for device.
[ +2 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _BuildIOSSubCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:270:7)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
Can anybody help me please?
Related
After update the flutter version the plugin Just_audio has stopped working giving me these exceptions (sometimes the code stop before and return less errors):
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: (-1) unknown error
#0 AudioPlayer._load
package:just_audio/just_audio.dart:850
<asynchronous suspension>
#1 AudioPlayer._setPlatformActive.setPlatform
package:just_audio/just_audio.dart:1435
<asynchronous suspension>
#2 AudioPlayer.load
package:just_audio/just_audio.dart:780
<asynchronous suspension>
#3 AudioPlayer.setAudioSource
package:just_audio/just_audio.dart:755
<asynchronous suspension>
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method load on channel com.ryanheise.just_audio.methods.26d4c1e0-6fef-4ed1-8917-3ea8d6e473e8)
#0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:313
<asynchronous suspension>
#1 MethodChannelAudioPlayer.load
package:just_audio_platform_interface/method_channel_just_audio.dart:58
<asynchronous suspension>
#2 AudioPlayer._load
package:just_audio/just_audio.dart:836
<asynchronous suspension>
#3 AudioPlayer.load
package:just_audio/just_audio.dart:780
<asynchronous suspension>
#4 AudioPlayer.setAudioSource
package:just_audio/just_audio.dart:755
<asynchronous suspension>
I have tried to clean the project and recover the plugin's versions of the previous code (that was working before the update)
I have tried in a real iPhone, restarted multiple times the computer, the IDE.
I have updated the plugins to the last version.
Can anyone tell me what can be the problem? I am trying to check for other plugins but if the code that was working before is not working now just with the flutter update...
I am running iOS 15.4.1 and VS Code March 2022 (version 1.66)
After upgrading to iOS 15.4.1, which could just be a coincidence, my Flutter app no longer runs in VS Code.
It just produces the error "Error launching application on [name of my phone]".
I have tried "flutter clean", rebooting my iPhone and rebooting my Mac, without success.
Interesting that when I run "flutter run --verbose" from a terminal window, the app launches on my iPhone, but with the following message:
[ ] Error launching application on [name of my iphone].
[ +3 ms] "flutter run" took 71,369ms.
[ +2 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
Any help is appreciated.
Thanks
When I'm trying to document my dart code, I get the following error:
Unhandled exception:
Invalid argument (uri): Unknown package: Instance of '_SimpleUri'
#0 ResourceLoader.resolveResourceUri.<anonymous closure> (package:dartdoc/src/generator/resource_loader.dart:41:11)
<asynchronous suspension>
#1 ResourceLoader.getResourceFile (package:dartdoc/src/generator/resource_loader.dart:31:15)
<asynchronous suspension>
#2 _DefaultTemplatesLoader.loadTemplate (package:dartdoc/src/generator/templates.dart:168:24)
<asynchronous suspension>
#3 Templates._create (package:dartdoc/src/generator/templates.dart:265:25)
<asynchronous suspension>
#4 initHtmlGenerator (package:dartdoc/src/generator/html_generator.dart:22:19)
<asynchronous suspension>
#5 Dartdoc.fromContext (package:dartdoc/dartdoc.dart:149:21)
<asynchronous suspension>
#6 main (file:///b/s/w/ir/cache/builder/src/third_party/dart/third_party/pkg/dartdoc/bin/dartdoc.dart:24:9)
<asynchronous suspension>
When I use the command dart --version, I get this:
Dart SDK version: 2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "linux_x64"
dartdoc --version:
dartdoc version: 0.42.0
Why is this happening? I'm new to dart, so I have no idea how to debug this.
I'm using the flutter_otp plugin for SMS.
It works fine on Android but I get this error on iPhone.
I tried different format for phone number but still the same error.
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
#2 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:542:29)
#3 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:528:64)
#8 new SmsSender._private (package:sms/sms.dart:313:44)
#9 new SmsSender (package:sms/sms.dart:307:23)
#10 FlutterOtp.sendOtp (package:flutter_otp/flutter_otp.dart:37:28)
#11 SignUpViewModel.sendOTP (package:checkin/backend/viewModels/signup_view_model.dart:122:17)
#12 SignUpView.build.<anonymous closure>.<anonymous closure> (package:checkin/backend/views/signup_view.dart:93:39)
#13 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
#14 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
#15 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
#16 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:256:7)
#17 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:158:27)
#18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20)
#19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
#20 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7)
#21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7)
#22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7)
#26 _invoke1 (dart:ui/hooks.dart:267:10)
#27 _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)
(elided 7 frames from dart:async)
═════════════════════════════════════════════════════════════════════════════
I do AngularDart development on Windows 10. I'm getting strange behavior with webdev recently. I have to run webdev like this:
C:\Users\galankus>C:\tools\dart-sdk\bin\pub.bat global run webdev
A tool to develop Dart web projects.
Usage: webdev <command> [arguments]
Global options:
-h, --help Print this usage information.
Available commands:
build Run builders to build a package.
help Display help information for webdev.
serve Run a local web development server and a file system watcher that re-builds on changes.
Run "webdev help <command>" for more information about a command.
If I try to run it directly, the below is what I get. Any ideas on how I can debug/fix this?
C:\Users\galankus>webdev
Crash when formatting: [Encoding] Unable to decode bytes as UTF-8.
RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Crash when compiling file:///C:/Users/galankus/AppData/Roaming/Pub/Cache/global_packages/webdev/bin/webdev.dart.snapshot,
at character offset 264110:
RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Edit: the below did not change anything, I still get the error above.
C:\Users\galankus>pub global activate webdev
Package webdev is currently active at version 0.2.3.
Resolving dependencies...
+ args 1.4.3
+ charcode 1.1.1
+ collection 1.14.10
+ io 0.3.2+1
+ meta 1.1.5
+ path 1.6.1
+ pub_semver 1.4.1
+ source_span 1.4.0
+ stack_trace 1.9.2
+ string_scanner 1.0.2
+ webdev 0.2.3
+ yaml 2.1.14
Precompiling executables...
Precompiled webdev:bin\webdev.
Installed executable webdev.
Activated webdev 0.2.3.
This was a bug in recent Dart versions that was fixed already.
Updating Dart and the global activated webdev package should fix it
To update a globally activated package, just activate it again:
pub global activate webdev
Use this Command to activate WebDev
dart pub global activate webdev