Skip to content

[tool_crash] build ios release - ArgumentError: Invalid argument(s) #59029

Closed

Description

@josh-burton

Command

flutter build ios --release -t lib/main_stage.dart --no-codesign --flavor stage --build-number=635

Steps to Reproduce

  1. attempt to build ios release on Flutter dev channel (2f7a59a)
  2. 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

  1. jonahwilliams commented on Jun 8, 2020

    @jonahwilliams
    Contributor

    The crash is on this line of code:

    globals.printStatus('Building $app for $logTarget ($typeName)...');

    This could happen if either app, logTarget, or typeName is null. app is null checked above, and logTarget is clearly set to a non-null value - so that leaves typeName.

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 9, 2020
  3. josh-burton commented on Jun 10, 2020

    @josh-burton
    ContributorAuthor

    @TahaTesser I don't think this is waiting on anything from me

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 10, 2020
  5. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    P1High-priority issues at the top of the work list
    on Jun 11, 2020
  6. josh-burton commented on Jun 15, 2020

    @josh-burton
    ContributorAuthor

    This issue has now moved into the beta channel.

  7. KevinTheGray commented on Jun 23, 2020

    @KevinTheGray

    @athornz have you found a solution/work-around to this?

  8. KevinTheGray commented on Jun 23, 2020

    @KevinTheGray

    I duplicated my scheme which was development to be Development, 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.

  9. josh-burton commented on Jun 25, 2020

    @josh-burton
    ContributorAuthor

    I haven't found a work-around yet. I'll try changing the scheme name when I get a chance.

  10. tijee commented on Jun 29, 2020

    @tijee

    Hey same problem here. flutter run --flavor something works fine but when building with flutter build --flavor something it fails because of the uppercase. If I rename my scheme Something it works 🤔

  11. josh-burton commented on Jul 3, 2020

    @josh-burton
    ContributorAuthor

    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_IDENTIFIER is 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.

  12. jmagman commented on Jul 6, 2020

    @jmagman
    Member

    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

    final String scheme = xcode.XcodeProjectInfo.expectedSchemeFor(buildInfo);

    xcode.XcodeProjectInfo.schemeFor(buildInfo);

    @athornz I know you already worked around this, but was your flavor $PRODUCT_BUNDLE_IDENTIFIER actually resolving to nothing?

    $ cd ios
    $ xcrun xcodebuild -configuration Release -showBuildSettings -workspace Runner.xcworkspace -scheme Stage -showdestinations
    

    (or whatever your configuration and scheme is named).

    flutter build ios --release -t lib/main_stage.dart --no-codesign --flavor stage --build-number=635 --verbose
    

    would be helpful output to see what the build settings are.

  13. josh-burton commented on Jul 6, 2020

    @josh-burton
    ContributorAuthor

    @jmagman my $PRODUCT_BUNDLE_IDENTIFIER was 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:

    Screen Shot 2020-07-07 at 10 23 00 AM

    Here's the output of xcrun:
    xc-run.txt

    And here's the output of flutter build:

    build-log.txt

  14. jmagman commented on Jul 6, 2020

    @jmagman
    Member

    Eh sorry I didn't mean to include the -showdestinations flag, but the run output is good enough.

    xcodebuild: error: The project named "Runner" does not contain a scheme named "Stage". The "-list" option can be used to find the names of the schemes in the project.
    

    So what's the output of:

    xcrun xcodebuild -workspace Runner.xcworkspace -list
    
  15. josh-burton commented on Jul 7, 2020

    @josh-burton
    ContributorAuthor
  16. jmagman commented on Jul 7, 2020

    @jmagman
    Member

    stage and Stage yup I think it's the scheme casing, good diagnosis, @KevinTheGray.

  17. jmagman commented on Jul 27, 2020

    @jmagman
    Member

    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.

  18. jmagman commented on Aug 4, 2020

    @jmagman
    Member

    @pcsosinski May be a good candidate for the next cherry-pick, not sure if cp: 1.20 is the right label anymore.

  19. pcsosinski commented on Aug 4, 2020

    @pcsosinski

    it is!

  20. pcsosinski commented on Aug 7, 2020

    @pcsosinski

    under review for CP to 1.20

  21. aloisdeniel commented on Aug 12, 2020

    @aloisdeniel

    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 named dev.

    I can confirm that the 1.21.0-7.0.pre-dev version it fixes the issue.

    Is there any planned release date for the cherry pick on 1.20 ?

  22. github-actions commented on Aug 17, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: crashStack traces logged to the consoletoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions