Recently, my code has unexpectedly stopped compiling when I try to debug. I'm running Flutter v0.5.1
The only reason I can think of to explain this is as this happened after I moved my flutter SDK from my desktop to a seperate folder.
This is the error I receive:
Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Error reading dependency file C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug\snapshot_blob.bin.d: java.lang.ArrayIndexOutOfBoundsException: 1
Oops; flutter has exited unexpectedly.
Crash report written to C:\Users\Jake\Desktop\Other\Flutter\myproject\flutter_14.log;
please let us know at https://github.com/flutter/flutter/issues.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 435
* What went wrong:
Execution failed for task ':app:flutterBuildDebug'.
> Process 'command 'C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
Gradle build failed: 1
Exited (sigterm)
This is the Flutter Log thats dumped in the myproject folder:
Flutter crash report; please file at https://github.com/flutter/flutter/issues.
## command
flutter build bundle --suppress-analytics --target C:\Users\Jake\Desktop\Other\Flutter\myproject\lib\main.dart --preview-dart-2 --filesystem-scheme org-dartlang-root --depfile C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug/snapshot_blob.bin.d --asset-dir C:\Users\Jake\Desktop\Other\Flutter\myproject\build\app\intermediates\flutter\debug/flutter_assets
## exception
RangeError: RangeError (index): Invalid value: Only valid value is 0: 1
```
#0 List.[] (dart:core-patch/dart:core/growable_array.dart:141)
#1 readDepfile (package:flutter_tools/src/base/fingerprint.dart:174)
<asynchronous suspension>
#2 Fingerprinter._getPaths (package:flutter_tools/src/base/fingerprint.dart:88)
<asynchronous suspension>
#3 Fingerprinter.doesFingerprintMatch (package:flutter_tools/src/base/fingerprint.dart:60)
<asynchronous suspension>
#4 KernelCompiler.compile (package:flutter_tools/src/compile.dart:104)
<asynchronous suspension>
#5 build (package:flutter_tools/src/bundle.dart:79)
<asynchronous suspension>
#6 BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:72)
<asynchronous suspension>
#7 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:344)
<asynchronous suspension>
#8 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:279)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#10 _rootRun (dart:async/zone.dart:1126)
#11 _CustomZone.run (dart:async/zone.dart:1023)
#12 runZoned (dart:async/zone.dart:1501)
#13 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#14 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:270)
#15 CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#16 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:309)
<asynchronous suspension>
#17 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#18 _rootRun (dart:async/zone.dart:1126)
#19 _CustomZone.run (dart:async/zone.dart:1023)
#20 runZoned (dart:async/zone.dart:1501)
#21 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#22 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:265)
<asynchronous suspension>
#23 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#24 new Future.sync (dart:async/future.dart:222)
#25 CommandRunner.run (package:args/command_runner.dart:109)
#26 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:174)
#27 run.<anonymous closure> (package:flutter_tools/runner.dart:59)
<asynchronous suspension>
#28 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#29 _rootRun (dart:async/zone.dart:1126)
#30 _CustomZone.run (dart:async/zone.dart:1023)
#31 runZoned (dart:async/zone.dart:1501)
#32 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#33 runInContext (package:flutter_tools/src/context_runner.dart:43)
<asynchronous suspension>
#34 run (package:flutter_tools/runner.dart:50)
#35 main (package:flutter_tools/executable.dart:49)
<asynchronous suspension>
#36 main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#37 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
```
## flutter doctor
```
[✓] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.17134.228], locale en-GB)
• Flutter version 0.5.1 at C:\Users\Jake\Desktop\flutter_windows_v0.5.1-beta\flutter
• Framework revision c7ea3ca377 (3 months ago), 2018-05-29 21:07:33 +0200
• Engine revision 1ed25ca7b7
• Dart version 2.0.0-dev.58.0.flutter-f981f09760
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\Jake\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.0)
• Android Studio at C:\Program Files\Android\Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[!] VS Code, 64-bit edition (version 1.25.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected devices (1 available)
• HTC Desire 510 • CC58XY408727 • android-arm • Android 4.4.3 (API 19)
! Doctor found issues in 1 category.
```
The errors; ✗ Flutter plugin not installed; ✗ Dart plugin not installed shouldn't be an issue, they are both installed according to VSCode and apparently this issue, due to case sensitive values not being recognised by flutter doctor, affects everyone on VSCode.
This was fixed after Günter suggested a flutter clean.
Follow below steps issue will be fixed
Change your Flutter channel to Master using below command
flutter channel master
the execute below command
flutter run
the issue will be solved and your dart version will be updated
I had the same issue in ubuntu 20.04
I changed my path to directory with no space now problem solved.
Please do the following steps. That worked for me. Only for Mac users.
Step 1: Remove Podfiles by
In mac
i) rm ios/Podfile
ii) rm ios/Podfile.lock
Step 2: Run flutter clean . It will remove the build folder and cleanup the project.
Step 3: Generate Podfiles by flutter run
Note: Don't use Pod init for Generate Podfile,
Because it doesn't create any dependancies.
Optional Step 4: If the Podfiles already generated then we can update it by pod install and pod update.
Also please make sure you are in ios folder.
i) cd ios
ii) pod install
iii) pod update
Note: Please make sure flutter_svg dependency should be flutter_svg: ^0.18.0 in pubspec.yaml
Related
App doesn't run on IOS simulators or building archive but runs on devices.
It used to run fine, suddenly (can't pinpoint what is currently different that could cause this) a similar issue happened on android with the File name is too long error after multiple flutter cleans, removing all caches it worked on a real device then on the simulators again, doesn't work for IOS though.
Error message
/Users/yassin/Library/Developer/Xcode/DerivedData/Runner-dnjtfjbcotehrpgzrmybaaeugzpl/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app: File name too long Command CodeSign failed with a nonzero exit code
Unhandled error domain NSPOSIXErrorDomain, code 63
More details on the error when running from xcode for a simulator:
Failure Reason: Unhandled error domain NSPOSIXErrorDomain, code 63 User Info: { FunctionName = IXCopyItemAtURL; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; SourceFileLine = 121; }
One weird behaviour i've noticed is that dart analysis is taking so long to launch, and when running on a device it builds in normal time but takes so long to install (4+ minutes) On a Macbook M1, on both android and ios which is something unusual.
Flutter doctor
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-arm, locale
en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.61.0)
Things i have tried:
Flutter clean + Flutter pub get
Deleting xcodes derived data folder + Restarting laptop and xcode
flutter pub cache repair
Pod install, update
Revoking all certificates, installing new ones
Closing automatic signing, downloading profile
Locking & unlocking Keychain login access.
Flutter run --verbose error logs:
An error was encountered processing the command
(domain=NSPOSIXErrorDomain, code=63):
copyfile of
file:///Users/yassin/Desktop/Projects/handles/build/ios/ipho
nesimulator/Runner.app/ to
file:///Users/yassin/Library/Developer/CoreSimulator/Devices
/B864AB8C-79BE-4A09-9351-DDCA31E8C22F/data/Containers/Shared
/SystemGroup/systemgroup.com.apple.installcoordinationd/Libr
ary/InstallCoordination/PromiseStaging/C21EB07A-E655-4BBA-8B
07-5DA8B5397AE4/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
[ +15 ms] Unable to install
/Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.app on
B864AB8C-79BE-4A09-9351-DDCA31E8C22F. This is sometimes caused by a
malformed
plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command
(domain=NSPOSIXErrorDomain,
code=63):
copyfile of
file:///Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.a
pp/ to
file:///Users/yassin/Library/Developer/CoreSimulator/Devices/B864AB8C-79BE-4A09-
9351-DDCA31E8C22F/data/Containers/Shared/SystemGroup/systemgroup.com.apple.insta
llcoordinationd/Library/InstallCoordination/PromiseStaging/C21EB07A-E655-4BBA-8B
07-5DA8B5397AE4/Runner.app failed: File name too long
Unhandled error domain NSPOSIXErrorDomain, code 63
Command: /usr/bin/arch -arm64e xcrun simctl install
B864AB8C-79BE-4A09-9351-DDCA31E8C22F
/Users/yassin/Desktop/Projects/handles/build/ios/iphonesimulator/Runner.app
[ +7 ms] Error launching application on iPhone 12.
[ +10 ms] "flutter run" took 445,079ms.
[ +14 ms]
#0 throwToolExit
(package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand
(package:flutter_tools/src/commands/run.dart:669:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1125: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:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:288: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:236: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:92:3)
<asynchronous suspension>?
What worked for me after many days was deleting all hidden files in the project folder besides git related ones, .idea, .packages etc.. As well as podspec.lock and the Build folder manually.
What worked for someone else with the same issue was "Removing the flutter installation folder, then fetching again from the repo"
Both options should hopefully solve your issue.
I have two iOS devices, iPhone 8 and iPhone 12 mini, both runs iOS 14.4.
Flutter debug works normally on iPhone 8, but it won't launch app on iPhone 12 mini. It will hang on launch screen and then just exit.
Running "flutter pub get" in myproject...
Launching lib/main.dart on XX iPhone in debug mode...
lib/main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: XYXYXYXYX
Xcode build done. 117,9s
Error launching application on XX iPhone.
Exited (sigterm)
I can start debugging from XCode on both devices, but even after successfull start from XCode, debug won't work from flutter next time when I run flutter run on iPhone 12 mini.
Runnin flutter run --release also works OK.
This is what I get at the end when I run flutter run --verbose
...
...
Application launched on the device. Waiting for observatory port.
[+30020 ms] Installing and launching... (completed in 61,6s)
[ +1 ms] Error launching application on Sheriff iPhone.
[ +5 ms] "flutter run" took 372.990ms.
[ +7 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:617:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1080:12)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:931:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:230:5)
<asynchronous suspension>
#11 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:9)
<asynchronous suspension>
#12 run.<anonymous closure> (package:flutter_tools/runner.dart:61:12)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#15 runInContext (package:flutter_tools/src/context_runner.dart:70:10)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
[ +85 ms] (lldb) process detach
[ +228 ms] ensureAnalyticsSent: 230ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ +56 ms] Shutdown hooks complete
[ ] exiting with code 1
flutter doctor
# flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.2.2 20D80 darwin-x64, locale sr-Latn-RS)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.52.1)
[✓] Connected device (1 available)
• No issues found!
Local network connection is allowed for the app on iPhone 12 mini.
I have tried all kinds of flutter clean, pod install, deleting DeriverdData, restarting iOS device etc. but it didn't work.
What am I missing here?
I've updated to FLutter 2.0.1 and now I am not able to run my app.
This is the error that I have:
Xcode build done. 34.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/ran/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.m:367:23: warning: 'mediaPlaybackRequiresUserAction' is deprecated: first deprecated in iOS 9.0 [-Wdeprecated-declarations]
configuration.mediaPlaybackRequiresUserAction = true;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/ran/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.h:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:211:28: note: 'mediaPlaybackRequiresUserAction' has been explicitly marked deprecated here
#property (nonatomic) BOOL mediaPlaybackRequiresUserAction API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(8.0, 9.0));
^
/Users/ran/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.m:374:23: warning: 'mediaPlaybackRequiresUserAction' is deprecated: first deprecated in iOS 9.0 [-Wdeprecated-declarations]
configuration.mediaPlaybackRequiresUserAction = false;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mediaTypesRequiringUserActionForPlayback
In module 'WebKit' imported from /Users/ran/Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.h:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:211:28: note: 'mediaPlaybackRequiresUserAction' has been explicitly marked deprecated here
#property (nonatomic) BOOL mediaPlaybackRequiresUserAction API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(8.0, 9.0));
^
2 warnings generated.
../../../Development/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.1/lib/src/picture_provider.dart:52:59: Error: No named parameter with the name 'nullOk'.
context != null ? Localizations.localeOf(context, nullOk: true) : null,
^^^^^^
../../../Development/Flutter/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {
^^^^^^^^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Community Edition (version 2020.2.1)
[✓] VS Code (version 1.53.1)
[✓] Connected device (2 available)
And this is my flutter run --verbose
[ +103 ms] Could not build the application for the simulator.
[ +3 ms] Error launching application on iPhone 12 Pro Max.
[ +3 ms] "flutter run" took 39,841ms.
[ +4 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#11 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#12 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#15 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
I have tried some online solutions like flutter clean and flutter run but it doesn't work.
Can you help me to solve this problem? Thank you and I really appreciate it.
The issue was caused by webview_flutter plugin using a deprecated function on iOS 9. More details are discussed on this issue ticket. This issue should be fixed in the latest version of the plugin.
Image assets unable to load when using iOS simulator. This error always happen when running flutter run command, but after I re-run using hot restart (shift+r) all image assets load successfully. If I stop the program and re-run using flutter run command again, it's still showing the same error. This is only happen when running in iOS.
Currently i'm using stable channel.
Flutter 1.7.8+hotfix.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b712a172f9 (9 days ago) • 2019-07-09 13:14:38 -0700
Engine • revision 54ad777fd2
Tools • Dart 2.4.0
I've already tried using master channel still not working, return back to stable channel again still not working either. Before running flutter run command I also running flutter clean but it's not changing anything.
This is my pubspec.yaml looks like.
flutter:
uses-material-design: true
assets:
- assets/images/
this is what i get in the console.
flutter: ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
flutter: The following assertion was thrown resolving an image codec:
flutter: Unable to load asset: assets/images/logo_idbalap.png
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 PlatformAssetBundle.load
package:flutter/…/services/asset_bundle.dart:221
flutter: <asynchronous suspension>
flutter: #1 AssetBundleImageProvider._loadAsync
package:flutter/…/painting/image_provider.dart:464
flutter: <asynchronous suspension>
flutter: #2 AssetBundleImageProvider.load
package:flutter/…/painting/image_provider.dart:449
flutter: #3 ImageProvider.resolve.<anonymous closure>.<anonymous closure>.<anonymous closure>
package:flutter/…/painting/image_provider.dart:316
flutter: #4 ImageCache.putIfAbsent
package:flutter/…/painting/image_cache.dart:160
flutter: #5 ImageProvider.resolve.<anonymous closure>.<anonymous closure>
package:flutter/…/painting/image_provider.dart:316
flutter: (elided 13 frames from package dart:async)
flutter:
flutter: Image provider: AssetImage(bundle: null, name: "assets/images/logo_idbalap.png")
flutter: Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#90c63(), name:
flutter: "assets/images/logo_idbalap.png", scale: 1.0)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
this is my flutter doctor -v response.
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14 18A391, locale en-ID)
• Flutter version 1.7.8+hotfix.3 at /Users/fakhrinf/Development/flutter
• Framework revision b712a172f9 (9 days ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/fakhrinf/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• CocoaPods version 1.7.4
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.2.0
[✓] Connected device (1 available)
• iPhone 6 • 0271F90D-7FA8-4728-908A-25E08B56AC50 • ios • iOS 12.0 (simulator)
• No issues found!
Lastly I try to uninstall the app and run flutter clean and flutter run again. I got this error.
Flutter crash report; please file at https://github.com/flutter/flutter/issues.
## command
flutter run
## exception
ProcessException: ProcessException: Process "/usr/bin/xcrun" exited abnormally:
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Failed to load Info.plist from bundle at path /Users/fakhrinf/Library/Developer/CoreSimulator/Devices/0271F90D-7FA8-4728-908A-25E08B56AC50/data/Library/Caches/com.apple.mobile.installd.staging/temp.6jf6We/extracted/Payload/Runner.app
Failed to load Info.plist from bundle at path /Users/fakhrinf/Library/Developer/CoreSimulator/Devices/0271F90D-7FA8-4728-908A-25E08B56AC50/data/Library/Caches/com.apple.mobile.installd.staging/temp.6jf6We/extracted/Payload/Runner.app
Underlying error (domain=MIInstallerErrorDomain, code=35):
Failed to load Info.plist from bundle at path /Users/fakhrinf/Library/Developer/CoreSimulator/Devices/0271F90D-7FA8-4728-908A-25E08B56AC50/data/Library/Caches/com.apple.mobile.installd.staging/temp.6jf6We/extracted/Payload/Runner.app
Command: /usr/bin/xcrun simctl install 0271F90D-7FA8-4728-908A-25E08B56AC50 /Users/fakhrinf/Development/Mobile/idbalapflutter/build/ios/iphonesimulator/Runner.app
#0 runCheckedAsync (package:flutter_tools/src/base/process.dart:259:7)
<asynchronous suspension>
#1 SimControl.install (package:flutter_tools/src/ios/simulators.dart:128:16)
#2 IOSSimulator._setupUpdatedApplicationBundle (package:flutter_tools/src/ios/simulators.dart:415:31)
<asynchronous suspension>
#3 IOSSimulator.startApp (package:flutter_tools/src/ios/simulators.dart:315:15)
<asynchronous suspension>
#4 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:371:54)
#5 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#6 _rootRunUnary (dart:async/zone.dart:1132:38)
#7 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#8 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#9 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#10 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#11 Future._complete (dart:async/future_impl.dart:473:7)
#12 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#13 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
#14 _rootRun (dart:async/zone.dart:1120:38)
#15 _CustomZone.run (dart:async/zone.dart:1021:19)
#16 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#17 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#18 _rootRun (dart:async/zone.dart:1124:13)
#19 _CustomZone.run (dart:async/zone.dart:1021:19)
#20 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#21 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#22 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#23 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#24 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#25 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
After many times dirty my flutter project by trying many things to solve the load assets issues, I decided to test it with new flutter project with --androidx flag on creation. I'm not really sure if it will affect anything in iOS but my project become error in iOS after I migrate my old project to androidx and publish it to playstore.
After creating the new project I copy my old pubspec.yaml, assets folder and lib folder, and it's works!
Good afternoon,
I try to run a Flutter project on iOS, previously successfully run on Android. However, I got an error:
"x86_64" is not an allowed value for option "ios-arch".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Failed to build /Users/user123/Downloads/my_app.
Command /bin/sh failed with exit code 255
I tried different solutions offered here about a variety of errors "Command /bin/sh failed with exit code XXX". But, none of them helped.
Also, I checked solutions on GitHub:
https://github.com/flutter/flutter/issues/9814.
At the same time, it is not completely clear for me how to implement them into iOS project.
I will be appreciated for any support.
Sincerely,
Maryna
Update: these are the results of the commands:
$ flutter run --verbose
[ +53 ms] executing: [/Users/user143726/Downloads/flutter/] git rev-parse --abbrev-ref --symbolic #{u}
[ +60 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic #{u}
[ ] origin/beta
[ ] executing: [/Users/user143726/Downloads/flutter/] git rev-parse --abbrev-ref HEAD
[ +10 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] beta
[ ] executing: [/Users/user143726/Downloads/flutter/] git ls-remote --get-url origin
[ +8 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ ] executing: [/Users/user143726/Downloads/flutter/] git log -n 1 --pretty=format:%H
[ +12 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ ] 5ab9e70727d858def3a586db7fb98ee580352957
[ ] executing: [/Users/user143726/Downloads/flutter/] git log -n 1 --pretty=format:%ar
[ +13 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ ] 3 weeks ago
[ +1 ms] executing: [/Users/user143726/Downloads/flutter/] git describe --match v*.*.* --first-parent --long --tags
[ +14 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ ] v0.8.2-0-g5ab9e7072
[ +508 ms] executing: /Users/user143726/Library/Android/sdk/platform-tools/adb devices -l
[ +32 ms] Exit code 0 from: /Users/user143726/Library/Android/sdk/platform-tools/adb devices -l
[ ] List of devices attached
[ +8 ms] executing: idevice_id -h
[ +98 ms] /usr/bin/xcrun simctl list --json devices
[ +449 ms] No connected devices.
[ ] Run 'flutter emulators' to list and start any available device emulators.
[ ] If you expected your device to be detected, please run "flutter doctor" to diagnose
[ ] potential issues, or visit https://flutter.io/setup/ for troubleshooting tips.
[ +18 ms] "flutter run" took 1,014ms.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3)
#1 RunCommand.validateCommand
(package:flutter_tools/src/commands/run.dart:239:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:350:11)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:306:33)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#5 _rootRun (dart:async/zone.dart:1124:13)
#6 _CustomZone.run (dart:async/zone.dart:1021:19)
#7 _runZoned (dart:async/zone.dart:1516:10)
#8 runZoned (dart:async/zone.dart:1463:12)
#9 AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#10 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:297:20)
#11 CommandRunner.runCommand (package:args/command_runner.dart:194:27)
<asynchronous suspension>
#12 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:347:21)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#14 _rootRun (dart:async/zone.dart:1124:13)
#15 _CustomZone.run (dart:async/zone.dart:1021:19)
#16 _runZoned (dart:async/zone.dart:1516:10)
#17 runZoned (dart:async/zone.dart:1463:12)
#18 AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:303:19)
<asynchronous suspension>
#20 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109:29)
#21 new Future.sync (dart:async/future.dart:224:31)
#22 CommandRunner.run (package:args/command_runner.dart:109:11)
#23 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:211:18)
#24 run.<anonymous closure> (package:flutter_tools/runner.dart:59:20)
<asynchronous suspension>
#25 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#26 _rootRun (dart:async/zone.dart:1124:13)
#27 _CustomZone.run (dart:async/zone.dart:1021:19)
#28 _runZoned (dart:async/zone.dart:1516:10)
#29 runZoned (dart:async/zone.dart:1463:12)
#30 AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#31 runInContext (package:flutter_tools/src/context_runner.dart:42:24)
<asynchronous suspension>
#32 run (package:flutter_tools/runner.dart:50:10)
#33 main (package:flutter_tools/executable.dart:52:9)
<asynchronous suspension>
#34 main (file:///b/build/slave/Mac_Flutter_Packaging/build/archive/flutter/packages/fl utter_tools/bin/flutter_tools.dart:8:3)
#35 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#36 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
$ flutter analyze
Analyzing my_app...
info • Unused import: 'package:my_app/main.dart' • test/widget_test.dart:10:8 • unused_import
1 issue found. (ran in 8.4s)
$ flutter doctor -v
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en)
• Flutter version 0.8.2 at /Users/user143726/Downloads/flutter
• Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700
• Engine revision 58a1894a1c
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
• Android SDK at /Users/user143726/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 28.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[!] VS Code (version 1.27.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
After lots of try i follow these steps to release ipa file :
Go to your trminal:
cd your-flutter-project
flutter run (That will launch the app to your connected or opened device )
Now,
come to again to your MAC terminal and type
flutter build apk (that will make the release apk)
For IOS,
flutter build ios
after complete the task you will see the path of your file package something like
/Users/Sanjeev/Documents/WorkSpaceForFlutter/myapp/build/ios/iph
oneos/Runner.app.
Now go to Xcode >Product >Archive you will get the screen below
This is how i resolve my issue
Command /bin/sh failed with exit code 255
I solve the problem with the following commands.
flutter clean
flutter build ios
After that I can create signed builds and also upload to App Stores.
This exit code (255) occurs from incorrectly Generated.xcconfig configuration like TRACK_WIDGET_CREATION, FLUTTER_FRAMEWORK_DIR, FLUTTER_BUILD_MODE
In archive ios release mode. So before archiving make sure to run flutter clean then flutter build ios for some reason flutter build ios --release doesn't work for me. Then lastly go to Xcode and archive the ios app
Commands
flutter clean then
flutter build ios
Hope it helps.
This issue happened to me after building a release version. It seems that iOS emulators does not support release versions.
If you want to run your app on an emulator you will need to build a debug version
flutter clean
flutter build ios --debug
For me, it happenned that I was opening .xcodeproj (WRONG) file instead of .xcworkspace (RIGHT)
For me helped:
Disconnect all physical phone's from mac.
Close Xcode.
In terminal command
flutter clean
Start Xcode by running Runner.xcworkspace, that you have inside your project folder /yourProjectFolder/ios/Runner
Choose menu Product - Archive
That's it! After that build was successful. Appear windows where you can distribute app.