Repository navigation
[tool_crash] build ios release - ArgumentError: Invalid argument(s) #59029
Description
Command
flutter build ios --release -t lib/main_stage.dart --no-codesign --flavor stage --build-number=635
Steps to Reproduce
- attempt to build ios release on Flutter dev channel (2f7a59a)
- the tool crashes
This project builds fine on the beta channel (2738a11)
Logs
Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.
## command
flutter build ios --release -t lib/main_stage.dart --no-codesign --flavor stage --build-number=635
## exception
ArgumentError: Invalid argument(s)
#0 _StringBase._interpolate (dart:core-patch/string_patch.dart:854:9)
#1 BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:90:70)
#2 _rootRunUnary (dart:async/zone.dart:1198:47)
#3 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#5 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#6 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#7 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#8 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#9 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#10 ApplicationPackageStore.getPackageForPlatform (package:flutter_tools/src/application_package.dart)
#11 _rootRunUnary (dart:async/zone.dart:1198:47)
#12 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#13 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#14 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#15 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#16 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#17 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#18 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#19 BuildableIOSApp.fromProject (package:flutter_tools/src/application_package.dart)
#20 _rootRunUnary (dart:async/zone.dart:1198:47)
#21 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#22 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#23 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#24 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#25 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#26 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#27 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#28 IosProject.hostAppBundleName (package:flutter_tools/src/project.dart)
#29 _rootRunUnary (dart:async/zone.dart:1198:47)
#30 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#31 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#32 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#33 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#34 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#35 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#36 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#37 IosProject._parseHostAppBundleName (package:flutter_tools/src/project.dart)
#38 _rootRunUnary (dart:async/zone.dart:1198:47)
#39 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#40 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#41 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#42 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#43 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#44 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#45 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#46 IosProject.buildSettingsForBuildInfo (package:flutter_tools/src/project.dart)
#47 _rootRunUnary (dart:async/zone.dart:1198:47)
#48 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#49 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#50 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#51 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#52 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#53 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#54 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#55 IosProject._xcodeProjectBuildSettings (package:flutter_tools/src/project.dart)
#56 _rootRunUnary (dart:async/zone.dart:1198:47)
#57 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#58 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#59 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#60 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#61 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#62 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#63 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#64 XcodeProjectInterpreter.getBuildSettings (package:flutter_tools/src/ios/xcodeproj.dart)
#65 _asyncErrorWrapperHelper.errorCallback (dart:async-patch/async_patch.dart:91:64)
#66 _rootRunBinary (dart:async/zone.dart:1214:47)
#67 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
#68 _FutureListener.handleError (dart:async/future_impl.dart:157:20)
#69 Future._propagateToListeners.handleError (dart:async/future_impl.dart:708:47)
#70 Future._propagateToListeners (dart:async/future_impl.dart:729:24)
#71 Future._completeError (dart:async/future_impl.dart:537:5)
#72 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:47:15)
#73 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart)
#74 _rootRunUnary (dart:async/zone.dart:1198:47)
#75 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#76 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#77 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#78 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#79 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#80 Future.wait. (dart:async/future.dart:409:22)
#81 _rootRunUnary (dart:async/zone.dart:1198:47)
#82 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#83 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#84 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#85 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#86 Future._complete (dart:async/future_impl.dart:519:7)
#87 _BufferingStreamSubscription.asFuture. (dart:async/stream_impl.dart:228:14)
#88 _rootRun (dart:async/zone.dart:1182:47)
#89 _CustomZone.run (dart:async/zone.dart:1093:19)
#90 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#91 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:410:13)
#92 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:420:15)
#93 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:305:7)
#94 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:97:11)
#95 _EventSinkWrapper.close (dart:async/stream_transformers.dart:23:11)
#96 _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#97 _Utf8ConversionSink.close (dart:convert/string_conversion.dart:305:20)
#98 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:82:18)
#99 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:142:24)
#100 _rootRun (dart:async/zone.dart:1182:47)
#101 _CustomZone.run (dart:async/zone.dart:1093:19)
#102 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#103 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:410:13)
#104 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:420:15)
#105 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:305:7)
#106 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
#107 _StreamController._closeUnchecked (dart:async/stream_controller.dart:644:7)
#108 _StreamController.close (dart:async/stream_controller.dart:637:5)
#109 _Socket._onData (dart:io-patch/socket_patch.dart:2027:21)
#110 _rootRunUnary (dart:async/zone.dart:1206:13)
#111 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#112 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#113 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#114 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#115 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#116 _StreamController._add (dart:async/stream_controller.dart:655:7)
#117 _StreamController.add (dart:async/stream_controller.dart:597:5)
#118 new _RawSocket. (dart:io-patch/socket_patch.dart:1563:35)
#119 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1045:18)
#120 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#121 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#122 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#123 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
## flutter doctor
[✓] Flutter (Channel dev, 1.19.0-4.0.pre, on Mac OS X 10.15.4 19E287, locale en-AU)
• Flutter version 1.19.0-4.0.pre at /Users/athor/dev/flutter
• Framework revision 2f7a59a (4 days ago), 2020-06-05 03:44:02 -0700
• Engine revision d17c84e7af
• Dart version 2.9.0 (build 2.9.0-13.0.dev 02915ec5ce)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/athor/dev/android-sdk
• Platform android-R, build-tools 29.0.3
• ANDROID_HOME = /Users/athor/dev/android-sdk
• Java binary at: /Users/athor/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-2/193.6514223/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 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Users/athor/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-2/193.6514223/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Android Studio (version 4.0)
• Android Studio at /Users/athor/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/193.6453388/Android Studio 4.0 Preview.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] Android Studio
• Android Studio at /Users/athor/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6507185/Android Studio 4.1 Preview.app/Contents
✗ 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_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
• IntelliJ at /Users/athor/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin version 46.0.3-dev.7
• Dart plugin version 201.7223.99
[✓] VS Code (version 1.45.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.10.1
[✓] Connected device (4 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
• macOS • macOS • darwin-x64 • Mac OS X 10.15.4 19E287
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.97
! Doctor found issues in 1 category.
Activity
jonahwilliams commentedon Jun 8, 2020
The crash is on this line of code:
flutter/packages/flutter_tools/lib/src/commands/build_ios.dart
Line 90 in 2f7a59a
This could happen if either
app,logTarget, ortypeNameis null.appis null checked above, andlogTargetis clearly set to a non-null value - so that leavestypeName.josh-burton commentedon Jun 10, 2020
@TahaTesser I don't think this is waiting on anything from me
josh-burton commentedon Jun 15, 2020
This issue has now moved into the beta channel.
KevinTheGray commentedon Jun 23, 2020
@athornz have you found a solution/work-around to this?
KevinTheGray commentedon Jun 23, 2020
I duplicated my scheme which was
developmentto beDevelopment, and now it works. Was there some change in the iOS build tool that capitalizes the first letter of the specified flavor? Looks like xcodebuild cares about the casing.josh-burton commentedon Jun 25, 2020
I haven't found a work-around yet. I'll try changing the scheme name when I get a chance.
tijee commentedon Jun 29, 2020
Hey same problem here.
flutter run --flavor somethingworks fine but when building withflutter build --flavor somethingit fails because of the uppercase. If I rename my schemeSomethingit works 🤔josh-burton commentedon Jul 3, 2020
I've done some debugging (well, printing variables - how do you debug flutter_tools?).
The issue is that
app.toString()evaluates to null, causing the invalid argument error. The toString implementation resolves to either the app displayName or id, which in my case were both null for some reason.My app has multiple flavors/schemes and for some reason the Product Bundle Identifier was set to 'multiple values', where as in other projects of mine it was
$PRODUCT_BUNDLE_IDENTIFIER. I fixed the issue by setting it to$PRODUCT_BUNDLE_IDENTIFIER.$PRODUCT_BUNDLE_IDENTIFIERis a custom variable I have defined for my schemes. I guess the root causes here is that displayName is not resolving the display name of the app from xcode in some situations.jmagman commentedon Jul 6, 2020
Based on the commit range and flavors/schemes manifestation, this is probably related to #56620.
@KevinTheGray @tijee for your issue, it's probably being too cute with casing, just glancing this line should maybe be
flutter/packages/flutter_tools/lib/src/project.dart
Line 511 in 4b12050
@athornz I know you already worked around this, but was your flavor
$PRODUCT_BUNDLE_IDENTIFIERactually resolving to nothing?(or whatever your configuration and scheme is named).
would be helpful output to see what the build settings are.
josh-burton commentedon Jul 6, 2020
@jmagman my
$PRODUCT_BUNDLE_IDENTIFIERwas resolving to the right values but it actually wasn't set as the product bundle identifier (setting it fixed the issue).Prefix this is what the xcode settings looked like:
Here's the output of xcrun:
xc-run.txt
And here's the output of flutter build:
build-log.txt
jmagman commentedon Jul 6, 2020
Eh sorry I didn't mean to include the
-showdestinationsflag, but the run output is good enough.So what's the output of:
josh-burton commentedon Jul 7, 2020
@jmagman here it is:
schemes_list.txt
jmagman commentedon Jul 7, 2020
stageandStageyup I think it's the scheme casing, good diagnosis, @KevinTheGray.jmagman commentedon Jul 27, 2020
This is available in
1.21.0-1.0.pre(currently the dev channel).The workaround is to rename your Xcode scheme to start with an uppercase letter matching your flavor name.
jmagman commentedon Aug 4, 2020
@pcsosinski May be a good candidate for the next cherry-pick, not sure if
cp: 1.20is the right label anymore.pcsosinski commentedon Aug 4, 2020
it is!
pcsosinski commentedon Aug 7, 2020
under review for CP to 1.20
aloisdeniel commentedon Aug 12, 2020
I'm facing the same issue (and my failing scheme is named
prod). The strange part is that one of my schemes work as expected and is nameddev.I can confirm that the
1.21.0-7.0.pre-devversion it fixes the issue.Is there any planned release date for the cherry pick on
1.20?github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.