xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH - Since updating Xcode - ios

Updated Xcode this morning and now ionic project wont deploy to a device.
ionic run ios --device
Returns:
** BUILD SUCCEEDED **
xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
Error: Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v
No idea what to do to fix, Googling returns lots of options but none correct.

Cordova is trying to use "PackageApplication" tool. But it was removed since Xcode 8.3. Either downgrade Xcode or wait for Cordova to have a fix for that.

Linked in the Jenkins issue that matson kepson mentioned here there was a guy who attempted a PR to fix the issue. There was some unfinished change requests in his PR and I also found a few null ptrs in his changes. I forked his pr and fixed these things here and there is now a snapshot linked here that you can download and become unblocked until such a change is merged into the full build.

Hi its official Bug from jenkins
here you have a fresh status
https://issues.jenkins-ci.org/browse/JENKINS-43163
Little bit clearer to look at this:
http://subathrathanabalan.com/2016/01/07/building-ipa-export-archive/

I've just come across this and my solution was to remove the iOS platform from the project:
ionic platform rm ios
Then add it back in again
ionic platform add ios
I needed to run an initial build for it to fail with no signing set, so opening up the project in Xcode to just fix that. After that, building via the ionic cli worked as expected. I am guessing that re-adding the platform pulled in a new version of cordova-ios.
Update: I had only started on this project and created the base project from the blank template. I have Xcode 8.3.1 installed and using Ionic 3 (still with the --v2 switch with ionic cli).

I used shenzhen this automatic procedure encountered a similar problem, and finally in accordance with the github Pull Request to solve my problem, hope for your reference!
https://github.com/nomad/shenzhen/pull/347

I found a workaround to solve this using command line, with device connected on your mac:
ionic build ios --device
ios-deploy --noninteractive --debug --bundle build/device/YOURAPP.app
After this, stop debug using Ctrl C, and your app will be working on your device.
Hope work for you guys.

The is caused by the deprecated PackageApplication. If you're using the remotebuild tool to run from Windows, it will be solved when the remotebuild bug has been fixed: https://github.com/Microsoft/remotebuild/issues/26

Another solution is to downgrade XCode.
Here if the explanation on how to uninstall current XCode.
And here you can download XCode 8.2.

An option is open a .xcodeproj file located at platforms/ios and run the project directly from Xcode.

Related

Flutter build iOS got error: Requested but did not find extension point with identifier

I just upgraded to Xcode 13.3-beta, running a flutter project got this error:
Error output from Xcode build:
↳
2022-03-02 17:45:38.148 xcodebuild[62848:6695836] 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-03-02 17:45:38.148 xcodebuild[62848:6695836] 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
** BUILD FAILED **
Now, I am confused, I am running a iOS app on simulator, why throughs out errors like watchOS?
And I totally don't know how to resolve this error.
Any one could help me?
OK, very weird but running xcrun multiple times seems to fix this. I had also updated to Xcode 13.3 recently.
xcrun -sdk iphoneos --show-sdk-path
The first time it shows the error. The second time it shows the right answer. I ran it with all three sdks, iphoneos, macosx, watchos and all showed the errors the first time. I also ran it with all five of the options for all three sdks:
xcrun -sdk iphoneos --show-sdk-path
xcrun -sdk iphoneos --show-sdk-version
xcrun -sdk iphoneos --show-sdk-build-version
xcrun -sdk iphoneos --show-sdk-platform-path
xcrun -sdk iphoneos --show-sdk-platform-version
The build error from xcodebuild went away after that, although I'm not certain which of the commands fixed it.
Fixed this by running.
xcrun -sdk macosx --show-sdk-path
This outputs your current skd path.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk
Add this to your .zshrc file.
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk
Source it
source ~/.zshrc
Now run
xcrun -sdk macosx --show-sdk-version
To avoid hard coding the version you can add this to your .profile:
export SDKROOT=$(xcrun -sdk macosx --show-sdk-path)
reload profile (source path to your profile) and run
xcrun -sdk macosx --show-sdk-version
to verify
Found solution:
Check for updates of Xcode in App Store (it should be updated
already, but just for confirmation)
Launch Xcode; it will ask you to install additional software. After installation finishes the errors will gone.
If it's a flutter project following step can be helpful:
Update MacOS
Update Xcode and command lines tools
Run flutter pub upgrade, flutter pub get in the project folder
Delete podfile.lock in ios folder of the project
Run cd ios, pod repo update, pod install in the project folder
This is problem from xcode when xcode select doesn't link with CommandLineTools
run below command for link it
// reset to the default command line tools path
xcode-select -r
// Link xcode-select with CommandLineTools
sudo xcode-select -s /Library/Developer/CommandLineTools
If that not working. Maybe problem from the keychain is not unlock.
You need to unlock that by
security unlock-keychain
Or with password
security unlock-keychain -p <password>
Hope this way can help you, thanks.
This issue is sadly with XCode 13.3.
This is pointed out by this answer - Stackoverflow Answer- Flutter for iOS run, build but not archive
The three solutions given were
Modify the code
Downgrade to Xcode 13.2.1
Wait for Apple to modify Xcode
For myself I use CodeMagic, and didn't have the luxury of downgrading my Archive. XCode could take months to update. So modifying the code was the only option. I was able to find this issue opened on March 15th 2022. Which eventually has this solution..
Open your Podfile and paste pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git' as shown below:
`target 'Runner' do
use_frameworks!
use_modular_headers!
#Workaround for segmentation fault:11 while archiving
#Add the below line
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end`
Yes I know your error said your errors were through WatchOS. However as I understand, this is an issue that occurs in version 13.3 of Xcode. In Xcode 13.3, if you have a code that uses UI_USER_INTERFACE_IDIOM(), you will get an "Out of Memory" error when you run Archive. Changing "UI_USER_INTERFACE_IDIOM()" to "UIDevice.current.userInterfaceIdiom" resolves the error. Commonly this issue occures with flutter pods using - DKImagePickerController/PhotoGallery.
I was able to fix this without touching anything Watch related. On top of this I made sure my flutter project had a minimum support level of 12, however that might be completely unrelated.
Ultimately downgrading is probably the solution. As well many of my links lead to other solutions if anyone is curious of the diving into it.
There is an error in file /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEWatchSupportCore.ideplugin/Contents/Resources/IDEWatchSupportCore.xcplugindata
You should make its backup, then open it in plist editor and fully remove the following items:
Root/plug-in/extensions/Xcode.DebuggerFoundation.AppExtensionHosts.watchOS
Root/plug-in/extensions/Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS
A workaround that worked for me was to install the previous stable Xcode version 13.2.1 and build it from the IDE.
You can have multiple versions installed, so you don't have to change anything in your current setup.
https://xcodereleases.com/
Check if there is some update for Xcode.
xcode-select --install
If you get the message below from the command above, try:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
Also, you should check if there is a macOS update available.
Click on the Apple icon no top left > About this mac > Software update (for example, macOS Monterey 12.3)
I faced the same problem when updating the project with Flutter 3. After several attempts, the below solution worked for me.
I have deleted the podfile.lock file inside the ios folder and then run the below commands.
flutter pub upgrade
flutter pub get
cd ios
pod repo update > Actually, this was an error for me but ignored it
pod install
Also please make sure you are using the latest MacOS and Xcode.
I hope this will help someone else.
In my case, its React Native app, the problem was with cocoa pods.
Reinstalling pods helped. Run below in your project folder
rm -rf ios/Pods && npx pod-install
Okay, just found a solution which might sound super dumb but updating my Mac OS to Moterey 12.3 solved the issue with no change in the code required.
Got this as well when trying to run the app from Android Studio. Solved this by...
starting XCode,
open the Runner,
run the app from xcode,
stop the app in xcode,
...and then it worked fine to run the app without this error from Android Studio.
I had the same issue , and i could solve it by removing the image picker newer package manually from the package folder and set the image picker package version to image_picker: 0.8.4 , and this solved the issue , hope it can help , maybe if you can share all the error message then i can help you .
you can try install the latest xcode13.3
then you can try xcode-select --install to install the command tools
Run command sudo xcode-select -s /Applications/Xcode.app
Finally, I found solution, hope this helpul for you.
Change flutter channel from stable to master
code#kazus-MacBook-Air ios %flutter channel master
code#kazus-MacBook-Air ios %flutter channel
Flutter channels:
* master
beta
stable
Also experiencing the same issue, I tried #user1503606 and #MCCCS suggestion, sadly didn't work.
Looking at this answer, the issue stems from XCode 13.3 and as #y2ducky suggests, downgrading should solve the issue.
Solutions:
Downgrade to Xcode 13.2.1 (you can find older versions here https://developer.apple.com/download/all/ then expand it and move Xcode (Xcode.app) to Applications folder, which will replace your current Xcode 13.)
Wait for Apple to modify Xcode
Using xcode version "13.2.1" works for me. Seems like "13.3" is doing something differently
Here is another one that helped me to solve this issue. Go to About this mac -> storage and remove support watchOS in Xcode developer settings.
Works with xcode 13.3.1, Monterey intel:
downgrade flutter sdk to Flutter ->2.10.0 Dart ->2.16.0
which can be downloaded here:
https://docs.flutter.dev/development/tools/sdk/releases?tab=macos
change your valid sdk path in terminal with flutter --version
this includes for new projects.
running May 1, 2022
Restart of iPhone solved the problem for me.
I brought another solution.
I tried multiple solutions which mentioned in this question, but all failed.
So, I just tried from flutter starting project. It did build perfectly. After adding some libraries, the library starts to require more higher ios version.
I usually upgrade ios version by Podfile like this,
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
but, instead of that, I upgraded ios version with Runner.xcworkspace and ios/Flutter/AppframeworkInfo.plist according to this link.
https://docs.flutter.dev/deployment/ios#review-xcode-project-settings
and after that, I finally succeeded to build project.
This also could be a problem with your pubspec.lock file. Some version of libraries probably trying to use Watch Support. That was the my case. So, I fixed some libraries's versions and then it worked fine.
This solution worked for me
Try xcode-select --install
If command line developer tools were already installed try fixing it by
sudo xcode-select -r
After a couple of days of trying all the solutions on the internet. I finally ended up deleting the ios folder inside the project and creating it again using flutter .
then Open Terminal and go to the project and do the follwing.
pub get
cd ios
pod install
And you can run the app now.
It could be this:
Try turning off your Apple Watch. I know... I know. I ignored it for a long time, then dug into the logs, the error messages, researched, etc.
The device name format changes when building when there's a watch involved and can sometimes hang up the Flutter tools because - well, because they're garbage and don't take that into consideration.
I basically just can't use my Apple Watch when I'm building on Flutter (some times), like at all. I have to power it down completely.
After you get a successful build, you may or not be able to turn it back on and have the builds succeed. It's hit and miss.
I get this problem every few weeks, and 100% of the time, it's my Apple Watch being on, changing the build targets that Flutter reads, presumably through Xcode.
** shrug **
In my case it was as simple as a new location added to assets within pubspec.yaml
assets:
- assets/images/
- assets/images/icons # this line broke the whole project because of a missing /
What helped in my case was to run update Xcode CLI to the newest (version: 13.4.0.0.1.1651278267
) which was only displayed with --all --install --force:
softwareupdate --all --install --force

How to fix ionic 2 Apple Mach-O Linker error?

I'm building an ionic 2 app, and I can build the app with ionic build ios and I get no erros, but on xcode when I build my application I get the following error.
Apple Mach-O Linker (id) Error
Linker command failed with exit code 1 (use -v to see invocation).
How can I fix this?
Here is my system information
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.0
OS: macOS Sierra
Node Version: v6.9.4
Xcode Version: Xcode 8.3 Build version 8E162
You are probably opening the .xcodeproj on Xcode, try opening the .xcworkspace. This fixed this error for me.
Had the same issue, spent almost a day trying to figure out what was causing it. For me the following solved it. Everything was working fine on ios#4.3.1, but on 4.5.3, I got this annoying error.
Check if this plugin "cordova-plugin-console" is there in the plugins folder. If it is there, remove it. Then it started building without any errors.
ionic cordova plugin remove cordova-plugin-console
Look for a file named libPods-AppName.a in Frameworks directory
where AppName is your app name.
Deleting it fixes it in most cases.
Take a look at the screenshot for reference.
Quick Fix
Disclaimer: My project uses Ionic v1
I had the same error and, once I had added a Android-only plugin, I thought that it was the cause of the error - I was wrong (so, ignore this cause if you think the same as I).
After some search I found the truly cause of the error: the cordova-ios version (4.5). I followed the steps suggested here and I solve this issue.
Steps:
ionic cordova platform remove ios
ionic cordova platform add ios#4.4.0
ionic cordova platform
Last step is used to check if ios#4.4.0 is actually the installed version.
Hope it helps.
In your platforms folder for ios, there are both .xcodeproj and .xcworkspace files. Open the /platforms/ios/.xcworkspace.
I found the issue that was causing this error.
On the config.xml file on the tag I had the email with my#email.com and you cannot have the .com on the email. I removed and it works fine now.
Thanks for the help

Developer Team IOS 10 Apache Cordova Build

I have the following problem when compiling a project in IOS 10. The project needs the Developer Team to compile correctly.
sudo cordova build ios --device
When you run the command, the following error:
In some forums JIRA official Apache Cordova, show the following solution:
issues.apache.org/jira/browse/CB-11845
I have not found a way to implement it properly to avoid this error. Build.xcconfig also attempt to modify the file, but I failed to fix the error.
If anyone has any ideas, I appreciate it very much.
Thank you.

I get "xcrun: error: SDK "iphonesimulator" cannot be located" when running the toolchain

I am trying to compile a Kivy program onto iOS, but when I run the command to build the Kivy distro I keep getting this error:
xcrun: error: SDK "iphonesimulator" cannot be located
I have xcode on my computer. What is going on?
A bit late, but I had the same error experimenting with kivy and this helped me:
Open in XCode Preferences, tab into Locations and take a look at your Command Line Tools selection. Mine was empty. When I changed it to the current used version suddenly the error was gone. I found this solution here (bottom): https://groups.google.com/forum/#!topic/rubymotion/Xw8gPcr2Fl8
If there is still something missing you can try to download an older IOS version to be sure there is something installed. Next to your appname you can select the device, click on it and select Download Simulations... and select the IOS you wish. I have done this step before the above, so I don't know if it's necessary.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
reason: if you download the xcode more than one version . the path is not only one....
It fixed for me once I downloaded the previous version of the simulator in my local.

Xcode - clang failed with exit code 1. Plugin cause?

I'm getting an odd error in Xcode when I try to Archive my app.
I'm using Ionic and the Ionic CLI tools. The app has been built for Android and is in beta on the Google Play store.
In Xcode I get this error:
clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/de.appplant.cordova.plugin.email-composer/APPEmailComposer.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
So it looks like there is some error with the de.appplant email plugin. The email plugin works in Android but it doesn't work in Ionic View on iOS. I wasn't sure if this was that the plugin isn't Ionic View compatible or not.
Anyone have any ideas?
Upate:
I uninstalled this plugin and I now get the same error, but from a different plugin!
clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/com.danielcwilson.plugins.googleanalytics/UniversalAnalyticsPlugin.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
So I'm pretty sure this is a plugin problem.
Anyone have any idea why or how I can fix it? I'm installing from the command line on a Mac with the standard cordova commands as seen on ngCordova.
edit: To be clear - those folders do not, indeed, exist. The plugins work fine in Android though...
Your error is quite strange, probably something happened to the structure folders..
I would try doing something like this:
Before doing this test make a backup copy of platforms/ios.
cd my-folder-app/
ionic platform remove ios
ionic platform add ios
Now should need to copy from backup and paste for example the icons, splash screens to the fresh platforms/ios folder and re-apply some eventual changes that you did.
ionic build ios
And then open xcode:
Run the app on emulator or device to test if works
Disconnect the device
Select the schema and iOS Device
If you need configure the schema, first you need to edit it:
Select Archive from the left panel, and from the right there is Build Configuration: select Release if you want publish the app or Debug if you want install the app on a test device. And click Close.
From the top menu: Product > Archive
Good luck!
UPDATE:
To be sure that your errors not depends to the ionic project make this test please:
cd projects-folder/
ionic start myTestApp tabs
cd myTestApp/
ionic platform add ios
ionic build ios
And now follow the same steps on xcode to archive the app.
I never really found out what was happening.
What I did was remove the iOS platform and re-add it. This just created more errors although for some reason the correct folders were there. I also then found my Android build wouldn't work.
I removed everything and re-added it all, updating Ionic too.
Then XCode would open but freeze. Hard freeze. The only way to quit it was to force close the Mac. I even uninstalled XCode and re-installed it. Same thing.
Finally I used the command line to erase all presets in XCode so it would open fresh without any projects loaded. Now it works, and the Android version seems to be working too.
I've no idea where the error started and so I can't rightly tag anyone as correct as that would be misleading. The solution: cleans and burn, start again. :)

Resources