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

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

Related

Ionic build fails Info.plist not found

Apple has tricked me and even though I disabled autoupdates it now pulled the most recent XCode version (Version 10.0 (10A255)) and dependencies. The effect is that I can not build my app anymore, even after removing (ionic cordova platform remove ios) and re-adding the platform.
It now fails with the error below.
onic cordova run ios --debug --target="iPhone-8" --consolelogs
...
<path>/platforms/ios/build/emulator/MyApp.app/Info.plist file not found.
[ERROR] An error occurred while running cordova run ios --debug --target iPhone-8 (exit code 1).
ionic --version
3.20.0
---- EDIT
ran with verbose and received :No scripts found for hook "before_deploy". as additional info for the failure.
----- EDIT ------
Please look here for more detail. I was able to reproduce it from scratch / a blank app template
Blank app fails debug build - /Info.plist file not found
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
Try this command it should work,this is issue with cordova.
If you're building on the command-line, try this
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
or
Xcode 10
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
Xcode example
Now, You can also run this on command-line $ionic cordova build ios
Best of luck

Cordova build iOS error: archive not found at path 'path/to/myApp.xcarchive"

I have been struggling to get Cordova to work and run on my iPhone. I follow the commands below but see error below at build:
cordova create myApp org.apache.cordova.myApp myApp
cd myApp
cordova platform add ios
cordova build ios
I get the error below:
Building project: /Users/ben/Desktop/myTest/platforms/ios/myTest.xcworkspace
Configuration: Debug
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/ben/Desktop/myTest/platforms/ios/myTest.xcarchive
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/ben/Desktop/myTest/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/ben/Desktop/myTest/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/ben/Desktop/myTest/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
error: archive not found at path '/Users/ben/Desktop/myTest/platforms/ios/myTest.xcarchive'
** EXPORT FAILED **
(node:4984) UnhandledPromiseRejectionWarning: Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,myTest.xcarchive,-exportOptionsPlist,/Users/ben/Desktop/myTest/platforms/ios/exportOptions.plist,-exportPath,/Users/ben/Desktop/myTest/platforms/ios/build/device
(node:4984) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4984) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have tried removing and adding platforms. Also, uninstalling stuff as well.
I'm on macOS High Sierra and Xcode 10.
There is a work around here.
If you're building on the command-line, you can specify --buildFlag="-UseModernBuildSystem=0":
# Cordova CLI
cordova run ios --buildFlag='-UseModernBuildSystem=0'
cordova build ios --buildFlag='-UseModernBuildSystem=0'
# Ionic CLI
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
If you're building with a build.json config file, you can add the following under the iOS release or debug config:
"buildFlag": [
"-UseModernBuildSystem=0"
]
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
Neither solution - --buildFlag="-UseModernBuildSystem=0" or setting the Legacy Build System worked for me.
For some reason, the error only goes away if I am sure to unplug my iPad or iPhone from usb on my computer before running the cordova build command.
Maybe something quirky about my configuration, but I thought I'd share in case it helps anyone else.
Cordova iOS supports the new build system since 5.0.0 (see release notes).
So update your package.json to "cordova-ios": "5.0.0" (or later) and call npm install.
Note, that I had to clean out everything (delete the directories platforms, plugins, www) afterwards in order for it to work.
If you don't want to set it in the build flag all the time, open your MyApp.xcworkspace and go to:
Sidenote: Yes you need to do this all the time by adding the ios platform in cordova. (e.g. you removed and added again the ios platform)
File > Workspace settings > Choose for Build System: Legacy Build
System
This also happens when you run cordova ios build --prod with a device connected to your mac. Unplug and try again.

Build Commands Failed Error Code 65 Ionic (iOS)

I'm using ionic to build my iOS app but im having this problem when running the command : "ionic build ios"
** BUILD FAILED **
The following build commands failed:
CompileC build/HR\ APP.build/Debug-iphonesimulator/HR\ APP.build/Objects-normal/i386/PushPlugin.o HR\ APP/Plugins/com.phonegap.plugins.PushPlugin/PushPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/user/desktop/hr/platforms/ios/cordova/build-debug.xcconfig,-project,HR APP.xcodeproj,ARCHS=i386,-target,HR APP,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/user/desktop/hr/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/user/desktop/hr/platforms/ios/build/sharedpch
Try This command
phonegap plugin remove phonegap-plugin-push
I had this same issue,
I would like to let you know my machine local environment setup-
******************************************************
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2 Build version 7C68
******************************************************
It generally occurs when we took app raw code form some other machine and try to build.
When I search for that I came to know that this issue is taking place due of spaces from build path
Steps I followed-
Opened app config.xml in editor.
Renamed App name such as-
<name>Rername App Title</name>
$ cordova plugin save
$ cordova platform rm ios
$ cordova platform add ios
After this I just build the app
$ ionic build ios
And that worked for me, hope you will get your issue resolved too.
This link helped me a lot-
https://forum.ionicframework.com/t/ionic-build-ios-fails-android-works/10515/2
Note:- Make sure you have complete icon and splash of the app for each platform i.e-
ionic resources

Ionic Build iOS - Fail

I've been workign on this project for months now with no major issues. Today I can't even get it to build out. I ran "$ionic resources" and now I can't get my build to work at all.
I'm getting this error:
** BUILD FAILED **
The following build commands failed:
CompileAssetCatalog build/emulator/Stopper.app Stopper/Images.xcassets
(1 failure)
ERROR building one of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/cordova/build-debug.xcconfig,-project,Stopper.xcodeproj,ARCHS=i386,-target,Stopper,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/sharedpch
You may not have the required environment or OS to build this project
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/cordova/build-debug.xcconfig,-project,Stopper.xcodeproj,ARCHS=i386,-target,Stopper,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/sharedpch
I'm not sure what caused the problem or how to fix it. Anyone have any idea?
Turns out I actually did need to uninstall the platform, remove the plugin json file, and then reinstall everything.
Run (this will remove the old ionic ios platform)
sudo ionic platform rm ios
Then (this will install a new platform with privileges)
sudo ionic platform add ios
Then build your code ios/android
ionic build ios
ionic build android
This fixed it for me!
Might be that you should also run
sudo ionic resources
to generate new icon and splash screens.
Basically, re-installation of Platform and Plugins once again resolves the issue.

Cant build Cordova ios. Error 65

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!!!

Resources