Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run flutter plugin On iOS Simulator Failed #34477

Closed
One1Light opened this issue Jun 14, 2019 · 21 comments · Fixed by #37036

Comments

@One1Light
Copy link

@One1Light One1Light commented Jun 14, 2019

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)
`

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jun 19, 2019

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

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jun 19, 2019

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

@itsyashjoshi

This comment has been minimized.

Copy link

@itsyashjoshi itsyashjoshi commented Jun 24, 2019

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.
@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jun 25, 2019

@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.
@One1Light

This comment has been minimized.

Copy link
Author

@One1Light One1Light commented Jun 25, 2019

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

@justinmc

This comment has been minimized.

Copy link
Contributor

@justinmc justinmc commented Jul 25, 2019

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.

@jmagman jmagman reopened this Jul 26, 2019
@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jul 26, 2019

@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?

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jul 26, 2019

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

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jul 26, 2019

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

@justinmc

This comment has been minimized.

Copy link
Contributor

@justinmc justinmc commented Jul 26, 2019

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.

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jul 26, 2019

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

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Jul 26, 2019

Temporary workaround in pubspec:

version: 0.0.1+0.0.1

flutter clean

@One1Light

This comment has been minimized.

Copy link
Author

@One1Light One1Light commented Jul 29, 2019

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

@joeblew99

This comment has been minimized.

Copy link

@joeblew99 joeblew99 commented Sep 9, 2019

@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.

@diegoveloper

This comment has been minimized.

Copy link
Contributor

@diegoveloper diegoveloper commented Sep 23, 2019

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.

@cjrams

This comment has been minimized.

Copy link

@cjrams cjrams commented Sep 24, 2019

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

@aleksei-a-savitski

This comment has been minimized.

Copy link

@aleksei-a-savitski aleksei-a-savitski commented Oct 3, 2019

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.

@smitthakkar1

This comment has been minimized.

Copy link

@smitthakkar1 smitthakkar1 commented Oct 5, 2019

@One1Light thanks a lotttttttttt. You saved my weekend.

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Oct 7, 2019

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

@Sunbreak

This comment has been minimized.

Copy link

@Sunbreak Sunbreak commented Oct 11, 2019

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

@jmagman

This comment has been minimized.

Copy link
Member

@jmagman jmagman commented Oct 11, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.