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!
Related
I encounter an error while I try to build my app for ios by flutter build ios. The error is related with flutter_tools packages. I tried to clean up my project with:
flutter clean
Delete Podfile.lock and re-run pod install in ios/ directory
Delete ios/Pods directory
I don't have other ideea what to do. Here is my entire error log:
[+1019 ms] "flutter ios" took 14,767ms.
[ +4 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:256:7)
<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>
[ +196 ms] ensureAnalyticsSent: 107ms
[ ] Running shutdown hooks
[ ] Shutdown hook priority 4
[ ] Shutdown hooks complete
[ ] exiting with code 1
And here is my flutter doctor --verbose :
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
• Flutter version 2.0.1 at /Users/ovidiuusvat/Flutter/flutter
• Framework revision c5a4b4029c (4 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/ovidiuusvat/Library/Android/sdk
• Platform android-30, build-tools 30.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_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (3 available)
• SM G970F (mobile) • RF8MA07GHKP • android-arm64 •
Android 11 (API 30)
• iPad Pro (12.9-inch) (4th generation) (mobile) • 7E3ECED2-13E7-465A-A1A1-077EF6EFFEE9 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript •
Google Chrome 88.0.4324.192
• No issues found!
For me the solutions for your error was flutter create .
I'm compiling a flutter app for android and iOS. The project compiles and runs on android emulators but I get a build error when I try to build the iOS version via VSCode or Android Studio.
Here is the build error:
error: Multiple commands produce
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner':
1) Target 'Runner' has copy command from '/Users/jdoe/Development/My-Great-App/my_great_app/ios/Runner' to
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner'
2) Target 'Runner' has link command with output
'/Users/jdoe/Development/My-Great-App/my_great_app/build/ios/Debug-development-iphonesimulator/Runner.app/Runner'
[ +49 ms] Could not build the application for the simulator.
[ +3 ms] Error launching application on iPhone 8.
[ +5 ms] "flutter run" took 79,020ms.
[ +18 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:607:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:972:18)
#3 _rootRunUnary (dart:async/zone.dart:1198:47)
#4 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#11 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#12 _rootRunUnary (dart:async/zone.dart:1198:47)
#13 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#14 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#15 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#16 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#17 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#18 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#19 _rootRun (dart:async/zone.dart:1190:13)
#20 _CustomZone.run (dart:async/zone.dart:1093:19)
#21 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#22 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#23 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#25 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
Here is my environment:
jdoe#MacBook-Air My Great App % flutter doctor -v
[✓] Flutter (Channel beta, 1.22.0-12.1.pre, on Mac OS X 10.15.6 19G2021, locale en-CA)
• Flutter version 1.22.0-12.1.pre at /Users/toddherron1a/Development/flutter
• Framework revision 8b3760638a (12 days ago), 2020-09-15 17:47:13 -0700
• Engine revision 4654fc6cf6
• Dart version 2.10.0 (build 2.10.0-110.3.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/toddherron1a/Library/Android/sdk
• Platform android-29, build-tools 29.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_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.10.0.rc.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (4 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• iPhone 8 (mobile) • 6F348FD9-AA18-4290-84EA-FB7A1AFB9F9E • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.121
• No issues found!
Things I've tried:
flutter clean
pod update
Removing VALID_ARCH from Xcode
There is no facebook login in this app, so this solution wasn't applicable.
I'm a bit stuck and I'm continuing development on Android for the time being. Any thoughts or ideas for getting the iOS build to work would be most appreciated!
The problem turned out to be duplicate GoogleService-Info.plist files in Xcode's Copy Bundle Resources (Targets • Runner • Build Phases).
Once both copies were removed using the "-", the build worked.
The thing is that I try to build a iOS release for a flutter app but it crashes I search for results about the errors but found nothing hope someone could help.
NOTE : The app launch and works perfectly on both IOS and Android but doesn't build on any of them. here is my post about the Android problem :
Android post
You can find below the result of my "flutter doctor -v" and "flutter build ios -v".
flutter doctor -v :
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15 19A602, locale en-FR)
• Flutter version 1.9.1+hotfix.5 at /Users/axel/flutter
• Framework revision 1aedbb1835 (4 days ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/axel/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10
(API 29) (emulator)
• iPhone 11 Pro • DB06E423-957F-41AA-99D0-05735D90C30B • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
• No issues found!
flutter build ios -v :
[ +118 ms] "flutter ios" took 19,172ms.
Encountered error while building for device.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:94:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:490:18)
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#4 _rootRunUnary (dart:async/zone.dart:1132:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#9 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#10 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#11 _rootRun (dart:async/zone.dart:1124:13)
#12 _CustomZone.run (dart:async/zone.dart:1021:19)
#13 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#14 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#15 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#17 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#18 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
Ok i found the problem, First i wasn't working with the stable flutter version i was with 1.10.x and going back to flutter 1.9.x-prefix.x made it run back again but the build din't work anymore, the thing that was making the build crash was that with the latest xCode version and since i was working with firebase cloud messaging i need to add back the mobile provision back in xCode part of my flutter app. – Axel Frau just now Edit Delete
i followed this tutorial : Firebase Cloud messaging to do this as on the project i'm working on somebody else did it before me.
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.
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