When I build a cordova project on Mac Catalyst on Xcode it gives me this error:
Myapp.app: unsealed contents present in the bundle root Command CodeSign failed with a nonzero exit code
What can I do?
Related
Environment
Mac OS X Version 12.1 (Apple M1 chip)
Xcode Version 13.2.1
Simulator Version 13.2 (972.2)
react-native-cli 7.0.3
node v18.4.0
The Issue
This is my first time working on developing an app using React Native. I am trying to run my React Native project on Xcode's simulator, using npx react-native run-ios. However, I am encountering this error message.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening MCompass.xcworkspace.
Command line invocation:
/Users/brx/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MCompass.xcworkspace -configuration Debug -scheme MCompass -destination id=DC3C75E6-19FD-4B80-87B1-62BF6404ED20
...
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/brx/src/projects/test/MCompass/ios/build/MCompass.build/Debug-iphonesimulator/MCompass.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'MCompass' from project 'MCompass')
(1 failure)
Between the first error message and ** BUILD FAILED **, there were many lines of output listing exports.
I've installed dependencies using both yarn and npm. I've also looked at several other threads with this same issue, but none of the solutions (such as having only one version of nvm or running react-native upgrade) have been successful. Does anyone have any tips?
I had my root folder name "REACT NATIVE", changing it to "REACT_NATIVE" fixed the error as the folder that contains your react native project cannot contain white spaces.
The second solution would be running Xcode with rosetta. This is only applicable for M1 chip macbooks as there are few times Xcode projects fail because of this reason. Please refer to below link for reference:
https://penny-huang.medium.com/xcode-how-to-run-ios-simulator-on-m1-mac-66101b9fccd8
When running cordova build ios on my ionic project, I received this error:
xcodebuild: Command failed with exit code 65
I've tried this solution: Ionic ios build fails, error archive not found
And this: https://forum.ionicframework.com/t/build-ios-error-code-65/120058
And this: https://github.com/apache/cordova-ios/issues/407
But nothing seems to work. I am running Ionic 5 with Angular 9.
I am on a Macbook Pro Mojave 10.14.6 and Xcode 11.3.1.
Any help would be greatly appreciated. Also, this was returned to me in yellow during the build: "No simulator found for ". Falling back to the default target."
Update:
People have asked for a full log of the error, so I ran cordova build ios --verbose:
NUS12256-9-darhart:status-app darhart$ cordova build ios --verbose
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform ios
Checking for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in ios platform
No differences found between plugins added to project and installed in ios platform. Continuing...
Generating platform-specific config.xml from defaults for iOS at /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/MyApp/config.xml
Merging project's config.xml into platform-specific iOS config.xml
Merging and updating files from [www, platforms/ios/platform_www] to platforms/ios/www
Current launch storyboard CDVLaunchScreen
Not changing launch storyboard setting in info plist.
Wrote out iOS Bundle Version "0.0.1" to /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/MyApp/MyApp-Info.plist
No need to update build settings for launch storyboard support.
Set IPHONEOS_DEPLOYMENT_TARGET to "11.0".
Did not update build settings for launch storyboard support.
iOS Product Name has not changed (still "MyApp")
Updating icons at platforms/ios/MyApp/Images.xcassets/AppIcon.appiconset/
Updating splash screens at platforms/ios/MyApp/Images.xcassets/LaunchImage.launchimage/
Updating launch storyboard images at platforms/ios/MyApp/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
No simulator found for ". Falling back to the default target.
Building for "iPhone 11 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max, iPhone-11-Pro-Max).
Building project: /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/MyApp.xcworkspace
Configuration: Debug
Platform: emulator
Target: iPhone 11 Pro Max
Running command: xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/sharedpch
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/emulator
SDKROOT = iphonesimulator13.2
SHARED_PRECOMPS_DIR = /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/sharedpch
note: Using new build system
note: Planning build
note: Constructing build description
error: /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/cordova/../pods-debug.xcconfig:2: could not find included file 'Pods/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig' in search paths (in target 'MyApp' from project 'MyApp')
error: /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/cordova/../pods-debug.xcconfig:2: could not find included file 'Pods/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig' in search paths (in target 'MyApp' from project 'MyApp')
error: /Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/cordova/../pods-debug.xcconfig:2: could not find included file 'Pods/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig' in search paths (in target 'MyApp' from project 'MyApp')
** BUILD FAILED **
Command finished with error code 65: xcodebuild -workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 11 Pro Max,build,CONFIGURATION_BUILD_DIR=/Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/platforms/ios/build/sharedpch
xcodebuild: Command failed with exit code 65
Error: xcodebuild: Command failed with exit code 65
at ChildProcess.whenDone (/Users/darhart/Desktop/Repositories/Darrow_Projects/status-app/status-app/node_modules/cordova-common/src/superspawn.js:135:23)
at ChildProcess.emit (events.js:311:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
Use the legacy build system of XCode to build app for iOS.
Open XCode, Go to File-> Workplace Settings-> Change build system to Legacy Build System.
Then you can run your app on iPhone simulator from the XCode itself.
In my case I resolved this issue by changing cordova-ios version from 4.5.5 to 5.1.1.
ionic cordova platform rm ios
ionic cordova platform add ios#5.1.1
Also check if any plugin is creating an issue, If it does then removing and again adding that plugin would be helpful.
check this one also https://github.com/apache/cordova-ios/issues/855#issuecomment-669214469
I am trying to build an archive for my flutter app on Xcode, bt I do not know why I kept getting this error.
Command PhaseScriptExecution failed with a nonzero exit code
I have my project migrated using the manual migration guildlines for the Xcode 11.4 version. My project runs well on the simulator though but I cannot build the .ipa archive file.
Logs
/Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Kashbase .app/Frameworks/Flutter.framework/Flutter: errSecInternalComponent
Non-fat binary /Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications//Kashbase .app/Frameworks/App.framework/App is not armv7. Running lipo -info:
Non-fat file: /Users/apple/Library/Developer/Xcode/DerivedData/Runner-acigcqmznpynacbcdnfflfigyoxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications//Kashbase .app/Frameworks/App.framework/App is architecture: x86_64
Command /bin/sh failed with exit code 1
Try this workaround:
Go to
Keychain Access -> Right-click on login -> Lock & unlock again
Xcode -> Clean Xcode project -> Make build again
Keychain Access
is a program in your Mac in Utilities. Cmd Tab keychain Access to find
it.
You can also try other solutions here if the workaround mentioned above is not working.
I am using Mac OS X 10.11. I am trying to deploy build to device (iPhone 4) by running sudo ionic run ios --device and I get this error message:
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/john/Desktop/Myproject/platforms/ios/cordova/build-debug.xcconfig,-project,Myproject.xcodeproj,ARCHS=armv7 armv7s arm64,-target,Myproject,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/john/Desktop/Myproject/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
I have no problem when running just only ionic run ios, which will deploy the app into emulator. How can I overcome the problem?
Another method will be
Go to your platform directory of your project /platforms/ios
Write in the console open . which will open your folder with Finder.
After that open YourProject.xcodeproj with XCode and select your device and click on run.
Good luck
I am developing an app with phonegap and I have always been testing the app using the android simulator and I have not had any problems, but I can not get it to work for iOS.
I'm working on a Mac OS mavericks and have installed Xcode.
When I run the command "phonegap run ios", I get the following:
[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] compiling iOS...
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/build/emulator
SDKROOT = iphonesimulator7.1
VALID_ARCHS = i386
xcodebuild: error: The project ‘NombreApp.xcodeproj’ does not contain a target named ‘NombreApp’.
[error] /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/cordova/build: Command failed with exit code 65
Any idea about what's going on?
EDIT: I solve this doing:
Remove ios folder from platforms.
Run again (phonegap run ios).
Install ios-sim with command sudo npm install -g ios-sim.
All worked fine!
A lot of thanks.
Best regards.
Manually create target with name NombreApp in Xcode as given this link :
->
How to create or define a new target in a custom Xcode project template
Regards,