Cant build Cordova ios. Error 65 - ios

My steps to make app:
I installed node js
I installed cordova: sudo npm install -g cordova
Then: npm install -g ios-sim
npm install -g ios-deploy
Also I downloaded simulator
Now I should be able to make project so:
cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add ios --save
cordova build
With "cordova build" this error appears:
The following build commands failed:
CompileXIB HelloWorld/Classes/MainViewController.xib
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/xXx/Desktop/Radko/hello/platforms/ios/cordova/build-debug.xcconfig,-project,HelloWorld.xcodeproj,ARCHS=i386,-target,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/xXx/Desktop/Radko/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/xXx/Desktop/Radko/hello/platforms/ios/build/sharedpch
Working on it for two days and no difference.

As mentioned by Radolnko
Run (This will remove the old cardova ios platform)
sudo cordova platform rm ios
Then (This will install a new platform with privileges)
sudo cordova platform add ios
Then
cordova build
This fixed it for me!

For me it was unchecking my app at Target Membership section in the .xib file itself.
Open the .xib file with xcode and in the right section at the bottom under Target Membership you will see a checkbox with your app's name.
Uncheck it!!!

Related

Blank app fails debug build - /Info.plist file not found

In a larger context I resorted back to creating a blank project and running my build commands.
Same error:
ionic start myApp blank
cd myApp
ionic cordova run ios --debug --target="iPhone-8" --consolelogs
ionic-app-scripts build --target cordova --platform ios
[11:39:29] ionic-app-scripts 3.2.0
[11:39:29] build dev started ...
[11:39:30] clean started ...
[11:39:30] clean finished in 1 ms
[11:39:30] copy started ...
[11:39:30] deeplinks started ...
[11:39:30] deeplinks finished in 15 ms
[11:39:30] transpile started ...
[11:39:33] transpile finished in 3.16 s
[11:39:33] preprocess started ...
[11:39:33] preprocess finished in 1 ms
[11:39:33] webpack started ...
[11:39:33] copy finished in 3.31 s
[11:39:37] webpack finished in 4.35 s
[11:39:37] sass started ...
[11:39:38] sass finished in 1.27 s
[11:39:38] postprocess started ...
[11:39:38] postprocess finished in 10 ms
[11:39:38] lint started ...
[11:39:38] build dev finished in 8.92 s
[11:39:41] lint finished in 2.65 s
> cordova run ios --debug --target iPhone-8
Building for iPhone 8 Simulator
Building project: /myApp/platforms/ios/myApp.xcworkspace
Configuration: Debug
Platform: emulator
Build settings from command line:
CONFIGURATION_BUILD_DIR =
/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator12.0
SHARED_PRECOMPS_DIR =
/myApp/platforms/ios/build/sharedpch
Build settings from configuration file '
/myApp/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
/myApp/platforms/ios/build/emulator/myApp.app/Info.plist file not found.
[ERROR] An error occurred while running subprocess cordova.
cordova run ios --debug --target iPhone-8 exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
ionic --version
4.1.2
cordova --version
8.0.0 & #latest 8.1.1
XCode Version 10.0 (10A255) + build tools
macOS 10.13.6 - High Sierra. Mojave on a different machine fails the same.
The paths are adjusted if anyone wonders...
-------------- FIX --------------
Together with #DaveAlden's answer this is how I got it back up to do livereload without the bugs:
ionic cordova platform remove ios
sudo npm install -g ionic#3.20.0
ionic cordova platform add ios
open platform/ios/MyApp.xcworkspace
Follow instructions to fall back to legacy build system as on
https://github.com/apache/cordova-ios/issues/407
Run my build script, without the --buildFlag='-UseModernBuildSystem=0'
This problem is caused because Xcode 10 contains a new build system which is currently not compatible with cordova-ios#4 - see here.
The solution for now is to run Cordova with the --buildFlag='-UseModernBuildSystem=0' option to instruct Xcode to use the old build system, e.g.:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
Update: For my own convenience, I've wrapped this in a shell script:
#!/bin/bash
# Adds build flag to make cordova-ios#4 work with Xcode 10
cordova "$#" --buildFlag='-UseModernBuildSystem=0'
I saved this in a file called cordova-xcode10, made sure it's in the path and made it executable (chmod a+x cordova-xcode10), then I can just do:
cordova-xcode10 run ios --target "iPhone-8"
and it will work with Xcode 10
This problem is caused because of Xcode 10.
I resolved this issue by two ways.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Create a build.json file on root of project.
In build.json write below code.
{
"ios": {
"debug": {
"buildFlag": ["-UseModernBuildSystem=0"]
},
"release": {
"buildFlag": ["-UseModernBuildSystem=0"]
}
}
}
After that you can run these commands without any error.
ionic cordova build ios
ionic cordova run ios
ionic cordova run ios --target="iPhone-6s" -l
This worked for me
Open your workspace file, then File --> WorkSpace Settings
In shared Workspace settings, choose Build System: Legacy Build System.
Then run ionic cordova run -l
Source(last comment): https://forum.ionicframework.com/t/fresh-ionic-fails-to-emulate-ios-12-info-plist-file-not-found/142291
Update
I just found out that Cordova IOS 5.0.0 was released.
https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html
This worked for me:
cd platforms/ios/cordova && npm install ios-sim#latest
This works for me:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
only add this flag in you command
cordova run ios --device --buildFlag='-UseModernBuildSystem=0' --verbose
work fine for me

React native runnig error on ios device

I am trying to run react native code to iphone, however it shows the following message.
The following code runs on Android normally, and on expo fine too, but it does not run on physical device.
Please help me.
E:\reactnative\cd webview
E:\reactnative\webview>react-native run-ios
Scanning folders for symlinks in E:\reactnative\webview\node_modules (38ms)
Found Xcode project webview.xcodeproj
spawnSync xcrun ENOENT
E:\reactnative\webview>
If you are using react-native-cli version 0.1.7 then you could either
Rollback to 0.1.7 (do not use '--verbose' argument)
npm install -g react-native-cli#0.1.7
or try it with the latest which might be fixed
npm uninstall -g react-native-cli
npm install -g react-native-cli
There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169

ionic build ios **export failed** error: exportArchive: Found no compatible export methds

When I run: ionic build ios the archive succeeds but the export fails.
Error Messages:
error: exportArchive: Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'
Error Domain=IDEFoundationErrorDomain Code=1 "Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'" UserInfo={NSLocalizedDescription=Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'}
Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,fasTask.xcarchive,-exportOptionsPlist,/Users/**PATH**/platforms/ios/exportOptions.plist,-exportPath,/Users/**PATH**/platforms/ios/build/device
I modified the exportOptions.plist 'method' key to 'export_method' but same error message.
I tried uninstalling Xcode and re-installing. The first build after re-installation gives me a successful build. Any builds after the first build give me the same error message as before.
Also if I npm uninstall -g ionic cordova and delete everything in the platform folder, then npm install -g ionic cordova then the first build succeeds but any build after it fails.
ionic serve works fine every-time.
Details:
Xcode 7.3.1
ionic 2.1.14
cordova 6.4.0
cordova-ios 4.3.1
ios-deploy 1.9.0
Thanks.
Hey I am having the same issue, it happened after updating ionic and cordova to the lastest version. I created a new project ionic start added platform ios and when trying ionic run ios --device i got the same output that you're having after building trying to export.
When running an older (pre-update) project i was not having any problem at all after i did a ionic platform rm ios and then ionic platform add ios the problem reproduced again. I think is has to be to the way that the updated cli is adding the platform or that it is expecting an updated SDK version (Xcode 8).
A workaround is first launch and installing the app to the device using Xcode, then in the terminal do ionic run ios --device -l this will create a livereload ionic server. At the end it will show the error but the livereload server will be still working and you can develop and the changes will be reflected on the app without any problem.
Xcode: 7.3.2
Ionic: 2.1.13
Cordova: 6.4
Try
ionic build ios --emulator

You may not have the required environment or OS to run this project - Cordova - iOS

I'm working with Cordova to build my mobile app. I'm working on a Mac machine and when I try to build and run my app on iOS device, but I'm keep getting this error.
When running:
cordova build ios
output:
** BUILD SUCCEEDED **
then I run
cordova run ios
I get the error
.../ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
If I try to open the project in Xcode and run it, it successfully run on the device.
I notice that before the run failed, it output the message
ios-sim was not found. Please download, build and install 'npm install -g ios-sim'
I'm guessing Cordova thinks the device isn't plugged in since the ios-sim is a simulatur plugin for cordvoa. But I may be wrong.
Any ideas?
(This question is similar to Cordova: You may not have the required environment or OS to run this project, but this question regarding iOS there that Android)
try
npm install -g ios-sim
npm install -g ios-deploy
I suggest you read iOS Platform guide for more info.

node install cordova / ionic / Foundation/Foundation.h not found

im trying to install cordova on a osx mavericks mac and get this error:
npm install -g cordova ionic
$ ionic start myApp tabs
$ cd myApp
$ ionic platform add ios
$ ionic build ios
..../platforms/ios/CordovaLib/CordovaLib_Prefix.pch:21:13: fatal error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
^
1 error generated.
XCode Command Line tools are up to date.
npm is up to date.
xcode version: Version 5.1.1 (5B1008)
cordova without ionic get the same error.
phonegap itself thet the same error.
any idea whats wrong?
thx
Been looking for answer to this for a couple of days and all I needed to do is to uninstall XCode (installed via AppStore). Then re-install it (will take some time coz the new XCode is 2.18GB!).
NOTE: Keep your current cordova, node, npm and ionic installs.

Resources