Skip to content

Run flutter plugin On iOS Simulator Failed #34477

Closed

Description

@One1Light

Launching lib/main.dart on iPhone Xʀ in debug mode... Xcode build done. 6.2s ProcessException: Process "/usr/bin/xcrun" exited abnormally: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22): Failed to install the requested application The application's Info.plist does not contain CFBundleVersion. Ensure your bundle contains a CFBundleVersion with a valid semantic version number. Command: /usr/bin/xcrun simctl install 14971B94-145F-4433-BB5E-6A9DF21A64B5 /xxxxxxx/example/build/ios/iphonesimulator/Runner.app
Run flutter doctor
`
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132,
locale zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version
28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.35.1)
[✓] Connected device (1 available)
`

Activity

  1. jmagman commented on Jun 19, 2019

    @jmagman
    Member

    What does "Run flutter plugin" mean? Can you include the commands you ran before you saw that error?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 19, 2019
  3. jmagman commented on Jun 19, 2019

    @jmagman
    Member

    And can you attach ios/Runner/Info.plist?

  4. itsyashjoshi commented on Jun 24, 2019

    @itsyashjoshi

    Facing the same Issue, adding log file below:
    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=NSPOSIXErrorDomain, code=22):
    Failed to install the requested application
    The application's Info.plist does not contain CFBundleVersion.
    Ensure your bundle contains a CFBundleVersion with a valid semantic version number.
    Command: /usr/bin/xcrun simctl install A956381E-24D8-448B-8C60-4DFBE8AF2B42 /private/tmp/fl_plugin/example/build/ios/iphonesimulator/Runner.app

    #0      runCheckedAsync (package:flutter_tools/src/base/process.dart:255:5)
    <asynchronous suspension>
    #1      SimControl.install (package:flutter_tools/src/ios/simulators.dart:125:16)
    #2      IOSSimulator._setupUpdatedApplicationBundle (package:flutter_tools/src/ios/simulators.dart:400:31)
    <asynchronous suspension>
    #3      IOSSimulator.startApp (package:flutter_tools/src/ios/simulators.dart:307:15)
    <asynchronous suspension>
    #4      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:364: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 (dart:async-patch/async_patch.dart:28:18)
    #14     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
    #15     ApplicationPackageFactory.getPackageForPlatform (package:flutter_tools/src/application_package.dart)
    #16     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
    #17     _rootRunUnary (dart:async/zone.dart:1132:38)
    #18     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #19     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
    #20     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
    #21     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
    #22     Future._complete (dart:async/future_impl.dart:473:7)
    #23     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    #24     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
    #25     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
    #26     FlutterProject.fromDirectory (package:flutter_tools/src/project.dart)
    #27     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
    #28     _rootRunUnary (dart:async/zone.dart:1132:38)
    #29     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #30     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
    #31     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
    #32     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
    #33     Future._complete (dart:async/future_impl.dart:473:7)
    #34     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    #35     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
    #36     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
    #37     FlutterProject._readManifest (package:flutter_tools/src/project.dart)
    #38     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
    #39     _rootRunUnary (dart:async/zone.dart:1132:38)
    #40     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #41     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
    #42     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
    #43     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
    #44     Future._complete (dart:async/future_impl.dart:473:7)
    #45     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    #46     _rootRunUnary (dart:async/zone.dart:1132:38)
    #47     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #48     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
    #49     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
    #50     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
    #51     Future._complete (dart:async/future_impl.dart:473:7)
    #52     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    #53     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
    #54     _rootRun (dart:async/zone.dart:1124:13)
    #55     _CustomZone.run (dart:async/zone.dart:1021:19)
    #56     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
    #57     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
    #58     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
    #59     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
    #60     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
    

    flutter doctor

    �[32m[✓]�[39m Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-IN)
        �[32m•�[39m Flutter version 1.5.4-hotfix.2 at /Users/Cognera/Developer/flutter
        �[32m•�[39m Framework revision 7a4c33425d (8 weeks ago), 2019-04-29 11:05:24 -0700
        �[32m•�[39m Engine revision 52c7a1e849
        �[32m•�[39m Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
    
    �[32m[✓]�[39m Android toolchain - develop for Android devices (Android SDK version 29.0.0)
        �[32m•�[39m Android SDK at /Users/Cognera/Library/Android/sdk
        �[32m•�[39m Android NDK location not configured (optional; useful for native profiling support)
        �[32m•�[39m Platform android-29, build-tools 29.0.0
        �[32m•�[39m Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        �[32m•�[39m Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
        �[32m•�[39m All Android licenses accepted.
    
    �[33m[!]�[39m iOS toolchain - develop for iOS devices (Xcode 10.2.1)
        �[32m•�[39m Xcode at /Applications/Xcode.app/Contents/Developer
        �[32m•�[39m Xcode 10.2.1, Build version 10E1001
        �[31m✗�[39m Verify that all connected devices have been paired with this computer in Xcode.
          If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
          To update with Brew, run:
            brew update
            brew uninstall --ignore-dependencies libimobiledevice
            brew uninstall --ignore-dependencies usbmuxd
            brew install --HEAD usbmuxd
            brew unlink usbmuxd
            brew link usbmuxd
            brew install --HEAD libimobiledevice
            brew install ideviceinstaller
        �[32m•�[39m ios-deploy 1.9.4
        �[32m•�[39m CocoaPods version 1.5.3
    
    �[32m[✓]�[39m Android Studio (version 3.4)
        �[32m•�[39m Android Studio at /Applications/Android Studio.app/Contents
        �[32m•�[39m Flutter plugin version 36.1.1
        �[32m•�[39m Dart plugin version 183.6270
        �[32m•�[39m Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    
    �[32m[✓]�[39m VS Code (version 1.35.1)
        �[32m•�[39m VS Code at /Applications/Visual Studio Code.app/Contents
        �[32m•�[39m Flutter extension version 3.1.0
    
    �[32m[✓]�[39m Connected device (1 available)
        �[32m•�[39m iPhone Xʀ • A956381E-24D8-448B-8C60-4DFBE8AF2B42 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
    
    �[33m!�[39m Doctor found issues in 1 category.
    
  5. jmagman commented on Jun 25, 2019

    @jmagman
    Member

    @itsyashjoshi I'm trying to figure out what the invalid or missing CFBundleVersion value is in the plist since I wasn't able to reproduce.
    Can you attach the following two files, and clearly mark which is which:

    1. <Your Flutter project path>/ios/Runner/Info.plist
    2. The Info.plist in the product app bundle. Open <Your Flutter project path>ios/Runner.xcworkspace in Xcode and then build via Product > Build against an iPhone simulator. The Info.plist path will be in your DerivedData directory somewhere like ~/Library/Developer/DerivedData/Runner-durhoqwtricbbcetrszcjktqoabc/Build/Products/Debug-iphonesimulator/Runner.app/Info.plist where the durhoqwtricbbcetrszcjktqoabc is random.
  6. One1Light commented on Jun 25, 2019

    @One1Light
    Author

    I did the following things to solve the problem
    add version: 1.0.0+1 to example .yaml。 @itsyashjoshi

  7. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 25, 2019
  8. justinmc commented on Jul 25, 2019

    @justinmc
    Contributor

    I ran into this as well. In ios/Runner/Info.plist, I had:

    ...
    	<key>CFBundleVersion</key>
    	<string>$(FLUTTER_BUILD_NUMBER)</string>
    ...
    

    So I guess somehow FLUTTER_BUILD_NUMBER isn't getting set? I do have a normal version: 0.0.1 in my pubspec.yaml.

    Manually replacing $(FLUTTER_BUILD_NUMBER) with 0.0.1 in Info.plist fixed it for me, but that's not ideal.

  9. jmagman commented on Jul 26, 2019

    @jmagman
    Member

    @justinmc FLUTTER_BUILD_NUMBER should be set in the Generated.xcconfig based on the pubspec.yaml "version". What is your version there, maybe it's being parsed incorrectly by the tool?

  10. jmagman commented on Jul 26, 2019

    @jmagman
    Member

    Sorry, I see now that you said it's version: 0.0.1.

  11. jmagman commented on Jul 26, 2019

    @jmagman
    Member

    But still, would like to run your pubspec.yaml through the parser. Can you paste the whole thing, @justinmc?

  12. justinmc commented on Jul 26, 2019

    @justinmc
    Contributor

    I talked to @jmagman offline and we found that a version number that starts with a "0" doesn't get parsed correctly. So as @One1Light mentioned, changing your version number in pubspec.yaml could be a solution to this until the parsing is fixed.

  13. jmagman commented on Jul 26, 2019

    @jmagman
    Member

    It looks like any version in the pubspec.yaml without a + doesn't get a FLUTTER_BUILD_NUMBER, and even if it does, it gets set to the number after the plus.
    https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/flutter_manifest.dart#L109

  14. 7 remaining items

  15. added this to the August 2019 milestone on Jul 26, 2019
  16. One1Light commented on Jul 29, 2019

    @One1Light
    Author

    In xcode's build, you need two Numbers, build number and version number. Version: 1.0.0+1 in pubspec.yml is split into the two Numbers you need by the compiled script. This is the logic of the flutter script build. In addition, I found that in some cases it was possible to compile without these two Numbers, but it still failed. Finally, even with these two Numbers set, you need to clear the installed APP and clean the build. To take effect

  17. joeblew99 commented on Sep 9, 2019

    @joeblew99

    @One1Light
    How do you "clear the installed app"

    I change my version in the pubspec to:
    version: 0.0.1+0.0.1

    then did:
    flutter clean
    flutter run --debug --build -d 'iPhone SE'

    But i still got the error.

  18. diegoveloper commented on Sep 23, 2019

    @diegoveloper
    Member

    same issue here after installing XCode11

    Flutter doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-PE)
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.0)
    [!] Android Studio (version 3.1)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [✓] VS Code (version 1.38.1)
    [✓] Connected device (1 available)
    

    Error

    Launching lib/main.dart on iPhone 8 in debug mode...
    Xcode build done.                                           253.0s
    ProcessException: Process "/usr/bin/xcrun" exited abnormally:
    An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
    Failed to install the requested application
    The application's Info.plist does not contain CFBundleVersion.
    Ensure your bundle contains a CFBundleVersion.
      Command: /usr/bin/xcrun simctl install 6E26EFA8-659D-4E37-B432-2C1DADEC9402 /my_project/build/ios/iphonesimulator/Runner.app
    Exited (sigterm)
    

    It was working before without any version in pubspec.yaml.

  19. cjrams commented on Sep 24, 2019

    @cjrams

    Similar error found using xCode 11 and flutter create --template=plugin test-plugin

    In this case I found useful this issue page, but is just an actual template issue.

    Test application pubspec.yaml lack of version information. So easy workaround adding it back asversion: 0.0.1

  20. aleksei-a-savitski commented on Oct 3, 2019

    @aleksei-a-savitski

    I added the following string to example/pubspec.yaml:

    version: 0.0.1+0.0.1
    

    and run flutter build ios after that.
    It fixed the issue.

  21. smitthakkar1 commented on Oct 5, 2019

    @smitthakkar1

    @One1Light thanks a lotttttttttt. You saved my weekend.

  22. jmagman commented on Oct 7, 2019

    @jmagman
    Member

    As of #40611 you should get a warning and instructions of how to fix, not a runtime error.

  23. Sunbreak commented on Oct 11, 2019

    @Sunbreak
    Contributor

    As of #40611 you should get a warning and instructions of how to fix, not a runtime error.

    After creating several plugins recently, I find the cause is missing of version: 0.0.1+1 in example/pubspec.yaml

    As far as I remember, flutter-1.7.8 works fine. May some problem in plugin template via flutter-1.9.1

  24. jmagman commented on Oct 11, 2019

    @jmagman
    Member

    #40611 was fixed in v1.10.5, which has made it to the dev and beta channel, but not stable yet.

  25. jiehu5114 commented on Jan 8, 2020

    @jiehu5114

    mark

  26. ch-muhammad-adil commented on Mar 30, 2020

    @ch-muhammad-adil

    I am using version like this inside pubspec.yaml ,
    version: 1.0.7+12

    open Your xCode and let it index for a while you will you will see the exact values.

    So in my case, You have to set CFBundleVersion and CFBundleShortVersionString values like this . Here is How info.plist will look after change.

    Screenshot 2020-03-30 at 3 18 39 PM

    You can use below source code too

    <key>CFBundleShortVersionString</key> <string>$(FLUTTER_BUILD_NAME)</string> <key>CFBundleVersion</key> <string>$(FLUTTER_BUILD_NUMBER)</string>

    Please paste it inside your info.plist file.

  27. lock commented on Apr 15, 2020

    @lock

    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.

  28. locked and limited conversation to collaborators on Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions