Flutter.io (dart) app fails to launch on iOS simulator - ios

I have up-to-date OSX Sierra, up-to-date XCode with applicable plugins, and an iPhone 6 simulator open and ready.
I have followed all the directions at https://flutter.io/setup-macos/#ios-setup.
When I "flutter run" from Terminal, the app fails to install on the simulator with message:
Could not build the application for the simulator.
Error launching application on iPhone 6.
Here is what Terminal said...
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 8.5s
Running Xcode build... 24.1s
Failed to build iOS app
Error output from Xcode build:
↳
2017-11-22 13:13:38.122 xcodebuild[47659:25935636] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13510/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command <C0009:'CpResource app.flx':P12>
Object: <PBXTargetBuildContext: 0x7fccf1235200>
Method: -createCommandInvocationRecordFromInvocation:
Thread: <NSThread: 0x7fccf2847ea0>{number = 16, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CopyPlistFile /Users/deborah/Desktop/chq_emulator/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist Runner/GoogleService-Info.plist
(1 failure)
Xcode's output:
↳
Build settings from command line:
ARCHS = x86_64
BUILD_DIR = /Users/deborah/Desktop/chq_emulator/build/ios
ONLY_ACTIVE_ARCH = YES
SDKROOT = iphonesimulator11.1
=== CLEAN TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
... list of subsidiary infomation ...
Could not build the application for the simulator.
Error launching application on iPhone 6.
Anyone else out there with advice for how to get Flutter going on the simulator?

Try running your Xcode first and make sure that it's up-to-date. Open the {flutter_project}/ios build on Xcode then try to run the iOS project on the Simulator from there.
If you're still having issues, you can run this command on your Terminal. This should set the path for the active developer directory.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Related

Xcode build fails and repetitive requires command line developer tools install

I have updated Xcode to Version 13.4.1 (13F100),
Then tried to run a flutter project
Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Xcode build done. 2.9s
Failed to build iOS app
Error output from Xcode build:
↳
2022-06-11 12:51:51.546 xcodebuild[45221:416597] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-11 12:51:51.547 xcodebuild[45221:416597] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-11 12:51:51.625 xcodebuild[45221:416597] [MT] DVTPlugInExtensionFaulting: Failed to fire fault for extension (null): (null)
2022-06-11 12:51:51.628 xcodebuild[45221:416597] [MT] DVTPlugInExtensionFaulting: Failed to fire fault for extension (null): (null)
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/l6/zr2yb4p1787b1cbhjdn2ltvr0000gn/T/flutter_tools.tQVcwl/flutter_ios_build_temp_dirmZJ1FK/temporary_xcresult_bundle
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
error: failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
(in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/l6/zr2yb4p1787b1cbhjdn2ltvr0000gn/T/flutter_tools.tQVcwl/flutter_ios_build_temp_dirmZJ1FK/temporary_xcresult_bundle
Error (Xcode): failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
Could not build the application for the simulator.
Error launching application on iPhone SE (3rd generation).
Exited
with an alert
The "actool" command requires the command line developer tools. Would
you like to install the tools now?
And if I run it from Xcode it gives me this error:
Showing All Messages
failed to read asset tags: The command `(cd /Volumes/Code/Git/svg/ios && /usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Volumes/Code/Git/svg/ios/Runner/Assets.xcassets)` exited with status 72. The command's standard error was:
actool: error: Failed to locate 'actool'.
xcode-select: Failed to locate 'actool', requesting installation of command line developer tools.
This repetitively occurs even if I press the "Install" button.
Same issue here, but with git instead of actool. Another coworker just also got this but with clang... what is going on over at apple?
What just fixed mine was actually opening up xcode and having it run its installer there instead of allowing the automatic pop-up to continue to "install" and then ask again in a few minutes.

Ionic Capacitor can no longer produce a buildable iOS project, CompileAssetCatalog error

Having intractable build issues with Ionic 6.5.0 / Capacitor 2.2.0
I made the app not long ago, but today it won't build. After much fruitless updating/cleaning/building I deleted the ios directory and re-added it.
ionic cap add ios
ionic cap sync
Updated, removed DerivedData, clean build, same error:
CompileAssetCatalog /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Products/Debug-iphoneos/App.app /Users/me/Projects//MyProject/ios/App/App/Assets.xcassets (in target 'App' from project 'App')
cd /Users/me/Projects//MyProject/ios/App
/Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Intermediates.noindex/App.build/Debug-iphoneos/App.build/assetcatalog_dependencies --output-partial-info-plist /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Intermediates.noindex/App.build/Debug-iphoneos/App.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --filter-for-device-model iPhone10,1 --filter-for-device-os-version 13.5.1 --sticker-pack-identifier-prefix com.prosc.itineris.sticker-pack. --development-region en --target-device iphone --target-device ipad --minimum-deployment-target 11.0 --platform iphoneos --product-type com.apple.product-type.application --compile /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Products/Debug-iphoneos/App.app /Users/me/Projects//MyProject/ios/App/App/Assets.xcassets
2020-06-15 15:40:01.929 ibtoold[73405:1839106] DEBUG: Added to environment: {
TMPDIR = "/var/folders/g8/hc3lzhqn75d1ms9dzt46s7nw0000gn/T/E2DC0A8E-13DD-4566-A0E9-59C812831E2A";
}
Command CompileAssetCatalog failed with a nonzero exit code
If I run this command from the terminal it appears to exit with a 255 status, no errors/warnings/notices.
I tried the recommended updates in XCode, but I'm seeing some errors in the Xcode prior to the failure:
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/Plugins/Network/Reachability.swift:207:4: Unexpected version number in 'available' attribute for non-specific platform '*'
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/Plugins/Permissions.swift:39:5: Switch covers known cases, but 'AVAuthorizationStatus' may have additional unknown values, possibly added in future versions
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/CAPBridge.swift:375:29: Coercion of implicitly unwrappable value of type 'String?' to 'Any' does not unwrap optional
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/CAPPlugin.m:6:17: Method definition for 'shouldOverrideLoad:' not found
I don't think these are causing the error, however. Any suggestions / insights?
The solution was to update XCode to 11.5 by installing a new build from the App Store. My version of XCode was not installed from the app store.
After updating the additional XCode tools, this updated actool from 11.2.1 to 11.5
This had nothing to do with Ionic/Capacitor, building a totally new native iOS app was exhibiting the same error.

vsCode doesn't run flutter app on physical iPhone

I just installed the latest version of flutter and xcode and I'm getting an error when I try running the flutter app on an actual iPhone. Works on ios simulator. The weird thing is that it works when I run it from xcode, but when I run it from vsCode, I get the following error:
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
What I tried doing:
Change the bundle identifier to myEmailAddress#gmail.com.appTitle
Clean and build the ios app
clean then ran flutter build bundle
What am I doing wrong and how can I get vsCode to run the app on an iPhone?
Here's the full error:
Launching lib/main.dart on Jessica’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ITYTO5RCWD
Xcode build done. 25.4s
Failed to build iOS app
Error output from Xcode build:
↳
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<DVTiOSDevice ...> == Underlying device preparation errors ==
2020-04-19 13:53:51.828 xcodebuild[2046:21215] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <"...platform info...">. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "...device info..."
}
--
2020-04-19 13:53:51.829 xcodebuild[2046:21215] [MT] iPhoneConnect: 📱<"...platform info..."> == END: Underlying device preparation errors ==
** BUILD FAILED **
Xcode's output:
↳
/Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.m:88:37: warning: incompatible pointer types sending 'FlutterEngine *' to parameter of type 'NSObject<FlutterBinaryMessenger> * _Nonnull' [-Wincompatible-pointer-types]
binaryMessenger:_headlessEngine];
^~~~~~~~~~~~~~~
In module 'Flutter' imported from /Users/Jessica/Development/flutter/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.15.1/darwin/Classes/AudioplayersPlugin.h:2:
/Users/Jessica/Desktop/flutter_game2/ios/Flutter/Flutter.framework/Headers/FlutterChannels.h:178:74: note: passing argument to parameter 'messenger' here
binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
^
1 warning generated.
/Users/Jessica/Desktop/flutter_game2/build/ios/Debug-iphoneos/Runner.app: resource fork, Finder information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Error launching application on Jessica’s iPhone.
Exited (sigterm)
Alright, so i solved this problem by pressing on the search icon on the top left of vscode, then searching for com.example
then i saw three search results that were in the ios folder click on it and replace all three com.example with the identifier you created in xcode.
you can change your signing identifier in Xcode
To do that, just open your workspace with app in Xcode, then go to signing and capabilities to change default com.example to anything else...
Better to use as follows to give app company / organization name
flutter create --org com.yourdomain your_app_name
Swift, Kotlin, and androidx dependencies are the default options
After just open the created project in Android Studio or in VSCode
Parameter
--org com.yourcompany
will form applicationId for Android:
com.yourcompany.yourappname
and iOS PRODUCT_BUNDLE_IDENTIFIER:
com.yourcompany.yourAppName
To explore all possible parameters type
flutter create --help

xcodebuild hangs on Xcode 11 beta, succeeds on Xcode 10

As the name of this post implies, I'm facing build-system issues with the Xcode 11 Beta. I worked since June on an update to my app, but only just recently attemped to archive it for TestFlight. Upon doing so, I found an issue where the archive never succeeds, but it also never fails. Instead it indefinitely hangs, never throwing an error or any hints as to why it's not conntinuing.
I've been able to isolate this issue to Xcode 11, as the identical codebase archives without a hitch in Xcode 10 (latest version as of writing).
I've submitted a radar with number FB7172492.
While I wait for a response to my radar, does any one here have any tricks as how I could either a) Get it to archive, or b) Get it to tell me what its stuck on.
It's worth noting, the build hang only occurs for the Release builds, any Debug build builds and runs without a problem.
xcodebuild
When I run xcodebuild in the terminal, like Xcode it hangs, and its file logs look like this:
INFO [2019-09-02 16:39:07.57]: ▸ [35m2019-09-02 16:39:07.577 xcodebuild[20349:464120] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fbfe8cbc1a0), Will’s iPhone, iPhone, 13.1 (17A5821e), 00008020-001131943A04002E> == Underlying device preparation errors ==[0m
INFO [2019-09-02 16:39:07.57]: ▸ [35m2019-09-02 16:39:07.577 xcodebuild[20349:464120] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fbfe8cbc1a0), Will’s iPhone, iPhone, 13.1 (17A5821e), 00008020-001131943A04002E> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.[0m
INFO [2019-09-02 16:39:07.57]: ▸ [35mDomain: com.apple.platform.iphoneos[0m
INFO [2019-09-02 16:39:07.58]: ▸ [35mCode: 5[0m
INFO [2019-09-02 16:39:07.58]: ▸ [35mFailure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fbfe8a3f120:'com.apple.platform.iphoneos':<DVTFilePath:0x7fbfe8a3ef90:'/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0[0m
INFO [2019-09-02 16:39:07.58]: ▸ [35m--[0m
INFO [2019-09-02 16:39:07.58]: ▸ [35m2019-09-02 16:39:07.577 xcodebuild[20349:464120] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fbfe8cbc1a0), Will’s iPhone, iPhone, 13.1 (17A5821e), 00008020-001131943A04002E> == END: Underlying device preparation errors ==[0m
It says can't connect to my device, but it really shouldn't be trying to do that, since I'm just building, not installing.
Any ideas?
This ended up being an issue with a framework called SwiftSoup, the library has been patched and archiving succeeds.

Error "Command failed with exit code 66" running ios simulator on meteor app

I am trying to run a simulation for ios of my meteor app, following all the steps:
meteor install-sdk ios
meteor add-platform ios
meteor run ios
But when I run the latter it gives me the following error:
Error while running for mobile platforms: Error running
/Users/ivanmac/.meteor/packages/meteor-
tool/.1.0.41.azxhr5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-
os.osx.x86_64/tools/cordova-scripts/cordova.sh
xcodebuild: error: 'test_app.xcodeproj.xcodeproj' does not exist.
Error: /Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/cordova/build: Command failed with exit
code 66
at ChildProcess.whenDone
(/Users/ivanmac/.meteor/packages/meteor-
tool/.1.0.41.azxhr5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-
os.osx.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-
lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Running command: /Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/cordova/build
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR =
/Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
VALID_ARCHS = i386
Only post I found on the internet talking about this was solved by changing the path, which I tried but didn't help. I'm using Meteor 1.0.3.2 and my xcode is on version 6. Does anyone have any idea of what might be happening?
Update to question
I just found out that if I run the .xcodeproj file on the cordova/ios folder manually the project runs fine, so I guess the path to look for the file to run on xcode when I run "meteor run ios" has an error.
Open platforms/ios/cordova/build and change
XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
to
XCODEPROJ=$( ls "$PROJECT_PATH" | grep --color=never .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
Source: phonegap build ios exception with HelloWorld Application

Resources