Cannot get Ionic 5 to deploy to physical device: Command PhaseScriptExecution failed - ionic-framework

I am trying to deploy an Ionic 5 project to an iPhone 12 running iOS 14.6 with XCode 11.4. The app runs fine on the emulator but after following the official instructions here I get Command PhaseScriptExecution failed error and in the logs directly before that is this error:
Code Signing /Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework with Identity Apple Development: xxx#gmail.com (7FSK2UE87Y)
/usr/bin/codesign --force --sign 7B0B8B04EB8EB60F0EB9540253FEC8FB09E379AC --preserve-metadata=identifier,entitlements '/Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework'
Warning: unable to build chain to self-signed root for signer "Apple Development: simonhill303#gmail.com (7FSK2UE87Y)"
/Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework: errSecInternalComponent
I followed the instructions to create my Apple cert and don't understand how to fix this error. I tried this answer Error Xcode 10 . PhaseScriptExecution failed with a nonzero exit code: errSecInternalComponent but could not get it to work.
UPDATE
It may be this problem https://developer.apple.com/support/expiration/:
Known Issues Xcode 11.4.0 and earlier may not be able to sign software
using signing certificates issued by the new Apple Worldwide Developer
Relations Certification Intermediate Certificate. If you’re unable to
upgrade to a supporting version of macOS or Xcode on your build
machine, you can build and archive your app using an earlier Xcode
client and sign it for distribution using the latest release.
Alternatively, you can utilize the codesign tool to sign your software
using the command line.
Definitely seems like this problem: https://developer.apple.com/forums/thread/660087

Updating XCode fixed the problem (12.4).

Related

Xcode error: building for iOS Simulator, but linking in object file built for iOS

Never had a lot of problems until the time to buy Macbook Air M1. Just yesterday my app was build without any error in Xcode 12.4. I did not make any special changes and today build failed:
/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please can you help me, how to solve it?
Looks like a missing Arm64 simulator slice in the OpenSSL-Universal CocoaPods distribution.
Make sure that you're using the latest version with pod update and contact the OpenSSL-Universal if there's still an issue.

clang: error no such file or directory: */Debug-iphonesimulator/MailCore/MailCore

I am using mailcore2 in my ios app from fetching my gmail account emails on my device. I have changed the ios sdkversion from 6.1 to 6.0 in the mailcore2 scripts bcz I am trying to compile and run the app using iPhone simulator 6.0 which uses ios sdkversion 6.0. Doing so I am getting the following clang error.
clang: error: no such file or directory: '/Users/shujaat/Library/Developer/Xcode/DerivedData/MyTestApp-ditognlaoajwldfliplqecnxqbfj/Build/Products/Debug-iphonesimulator/MailCore/MailCore'
While trying to compile and run my app using iphone simulator 6.1 (uses ios sdk 6.1), with no changes in the ios sdk version in the shell scripts, I am getting the following error:
/bin/sh /Users/shujaat/Documents/WemoTech/Products/WantList/sourcecode/ThirdPartyLib/MailCore2/Externals/builds/workdir/20130930192723/src/libetpan/build-mac/update.sh
configuring
running prepare-cyrus-sasl.sh
prepare sources
patching file lib/client.c
building tools
generated makemd5i386 properly
building for iPhoneOS - armv7
CONFIGURE FAILED
Command /bin/sh failed with exit code 1
These issues are driving me crazy for the last couple of days. Need your help.
Go to your main project target->"Build phases"->"Target dependencies" add mailcore2 ios
You need to read Check Adding MailCore to Your iOS Project carefully.
These issues are fixed now. I want to explain what I did to get rid of them for others facing same issues:
I made a separate project, and made mailcore2 as a part of it (didn't include the #import line in any of the project files at first). I compiled and run the project and copied the resultant mailcore 2 from it to my original project. It's compiling and running fine now.

build of MobileVLC for iOS fails

I'm trying to compile VLC player for iOS.
I've cloned git from repo, a tried to run "buildMobileVLC.sh" (using this wiki documentation)
$ git clone git://git.videolan.org/MobileVLC.git
$ cd MobileVLC
$ ./buildMobileVLC.sh
But as the result I have in terminal next:
SDKROOT not specified, assuming /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
*** /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk does not exist, please install required SDK, or set SDKROOT manually. ***
Even this
./buildMobileVLC.sh -k iphoneos5.0
can't help to solve the problem
P.S. When I try:
./buildMobileVLC.sh -h
It says
-k Specify which sdk to use (see 'xcodebuild -showsdks', current: iphoneos5.0)
What am I doing wrong? And should I install iPhone SDK 5.1, if "yes", then how?
UPD:
I changed
SDK_VERSION=5.0
in file "build.sh" in /Users//MobileVLC/ImportedSources/vlc/extras/package/ios
The error disappeared but the new error in Terminal is:
./libavutil/arm/asm.S:180:cannot use register index with PC-relative addressing -- `ldr r4,[pc,r4]'
./libavutil/arm/asm.S:180:cannot use register index with PC-relative addressing -- `ldr lr,[pc,lr]'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libavcodec/arm/ac3dsp_armv6.o] Error 1
make: *** [.ffmpeg] Error 2
Yes you should install the iOS SDK, you can get it by installing Xcode from the Appstore.
Error is telling you that the SDK can not be found, after you install Xcode the SDK will be installed.
With the new Xcode the SDK is in the Xcode bundle, /Applications/Xcode.app/Contents/Developer
As suggest you could set the SDKROOT to this path if it can't find the SDK.
It appears that the mobile build for VLC is broken: http://forum.videolan.org/viewtopic.php?f=12&t=103322

iPhone codesign error (ResourceRules.plist: cannot read resources) when attempting to share app

I'm attempting to share my app ad hoc. I can build and run it on my device but when I archive it and attempt to share it I get a strange error I've never seen before, see below. Any suggestions?
error: /usr/bin/codesign --force --preserve-metadata --sign iPhone Distribution: Joe Blogs--resource-rules=/var/folders/7z/gv6v8fqx737d6k1sytnchgrh0000gn/T/0ePfwPLHPA/Payload/My App.app/ResourceRules.plist --entitlements /var/folders/7z/gv6v8fqx737d6k1sytnchgrh0000gn/T/0ePfwPLHPA/entitlements_plistd2eAQQ_S /var/folders/7z/gv6v8fqx737d6k1sytnchgrh0000gn/T/0ePfwPLHPA/Payload/My App.app failed with error 1. Output: /var/folders/7z/gv6v8fqx737d6k1sytnchgrh0000gn/T/0ePfwPLHPA/Payload/My App.app/ResourceRules.plist: cannot read resources
The app you're trying to build is probably invalid. Are you sure you're building against the iphoneos SDK and not the simulator SDK ?
Can you provide the xcodebuild command that produced your .app file

Build fail error

I am baffled about this error since I installed xcode 4.2 from xcode 3.2 and switched back to xcode 3.2 Since then I am not able to build for device for any of my projects for any configurations.
The error shown is:
CodeSign build/Debug-iphoneos/MyProject.app cd
"/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject" setenv PATH
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: Madhup (MW9495NA8W)"
"--resource-rules=/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app/ResourceRules.plist"
--entitlements "/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/MyProject.build/Debug-iphoneos/MyProject.build/MyProject.xcent"
"/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app"
/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app: object
file format invalid or unsuitable Command /usr/bin/codesign failed
with exit code 1
The things I have tried to get over this are:
Completely removed all provisioning profiles and certificates and re-install them.
Change configurations (Debug to some other)
Completely uninstall and re-install xcode
Moreover if I try to build my project from some other systems with same provisioning profile, developer certificate and same build configuration I don't face any problem.
Please help me out as I am so frustrated and thinking of OS re-install :(
So to clarify, you've removed xcode with...
sudo /Developer/Library/uninstall-devtools –mode=all
Have you also cleaned the build (Product menu -> Clean)? I know this sounds a bit of an obvious one - but lots of people forget to do it!