Code 65 build error on Ionic Framework out of nowhere? - xcode

I have been working on an app using Ionic Framework for a while and I have recently gotten this error after running sudo ionic cordova build ios:
The following build commands failed:
Ld build/emulator/Aqua\ Hydration.app/Aqua\ Hydration normal x86_64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/andrewrodebaugh/aqua/platforms/ios/cordova/build-debug.xcconfig,-workspace,Aqua Hydration.xcworkspace,-scheme,Aqua Hydration,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/andrewrodebaugh/aqua/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/andrewrodebaugh/aqua/platforms/ios/build/sharedpch
[ERROR] An error occurred while running cordova build ios (exit code 1).
Full Log
Also my ionic info:
$ ionic info
cli packages: (/Users/andrewrodebaugh/aqua/node_modules)
#ionic/cli-utils : 1.18.0
ionic (Ionic CLI) : 3.18.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
#ionic/app-scripts : 3.0.1
Cordova Platforms : ios 4.6.0-dev
Ionic Framework : ionic-angular 3.8.0
System:
ios-deploy : 1.9.2
Node : v6.11.3
npm : 2.15.12
OS : macOS High Sierra
Xcode : Xcode 9.1 Build version 9B55
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : legacy
Thanks!
Sorry if this information is too much I just have been stuck on this error for too long so I need help.

Related

I cant get my ionic app to open in iOS emulator

My new ionic app won't run in the iOS emulator.
Its a fresh install of ionic and Xcode, these are my steps:
npm install -g ionic
ionic start myApp tabs
ionic cordova platform add ios
ionic cordova build ios
ionic cordova emulate ios
Then I get the following error:
No target specified for emulator. Deploying to undefined simulator
/localhost/myApp/platforms/ios/build/emulator/MyApp.app/Info.plist
file not found.
According to this thread (Fresh Ionic Fails to Emulate iOS 12 - Info.plist file not found) it should work with the following command:
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
But then I get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
And then according to this thread (Issues starting iOS simulator from CLI) it should work by updating ios-sim like this:
cd platforms/ios/cordova && npm install ios-sim#latest
But I still get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
Ionic:
ionic (Ionic CLI) : 4.10.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.0.1
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
The problem lie with ios-sim package which couldn't detect running simulators.
Updating to 8.0.1 with the following steps resolved the issue for me.
force update ios-sim to a working version
IMPORTANT needs to be done from inside the platforms/ios/cordova directory.
cd platforms/ios/cordova && npm install ios-sim#8.0.1
check if devices are now listed, takes a few seconds
ionic cordova emulate --list
installs appscript if not installed already
ionic cordova build ios
try to deploy to simulator
ionic cordova emulate --release --prod --livereload ios -- --buildFlag="-UseModernBuildSystem=0"
This will find any running simulator and deploy the app
Try just building the project and then running it from Xcode instead first.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Then open the platforms/ios folder in Xcode and you'll be able to run it from there plus see any errors there may be with the project. When you eventually decide to push the app to the store you'll need to do this anyway.
EDIT
Then try targeting a specific emulator:
ionic cordova emulate ios --list get list of available targets to copy into the next command.
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1" example targeting iPhone XR.
The issue is related to a breaking changes on Xcode 10 not already reflected on ios-sim. You can check on ion-sim repo issue "List empty of devices simulator with Xcode 10".
The issue have already been fixed but is waiting for a new release submission.
You can continue running your App on emulator directly from Xcode.

Ionic Unexpected key "NSMainNibFile~ipad" while parsing <dict/>

I am having an issue while using add platform ios command to build ios app in ionic project. The project builds successfully in android but not is IOS.
Command used:
ionic cordova platform add ios
Error:
Using cordova-fetch for cordova-ios#~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
Path: ../../documents/a-copy/platforms/ios
Package: com.qodelogix.assurant
Name: Assurant Drive
iOS project created with cordova-ios#4.5.5
Installing "cordova-android-support-gradle-release" for ios
Installing "cordova-plugin-braintree" for ios
Embedded Frameworks in cordova-plugin-braintree
Added Arch stripping run script build phase
Installing "cordova-plugin-camera" for ios
Failed to install 'cordova-plugin-camera': Error: Unexpected key "NSMainNibFile~ipad" while parsing <dict/>.
Ionic Info:
Ionic:
ionic (Ionic CLI) : 4.5.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : browser 5.0.3
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.0, (and 12 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 5.1.0
NodeJS : v8.11.4 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Please help me fix this error. Any help is appreciated.

cordovaProject.projectConfig.getFileResources is not a function in ionic project

I get this error, when trying to run an ionic app on android with livereload.
cordovaProject.projectConfig.getFileResources is not a function
When I try to re-install cordova, I get the same error. (npm install -g ionic cordova).
I removed the platform.
cordova platform rm android
and added it again:
cordova platform add android --save
All that changed nothing.
This is my ionic info output:
Ionic:
ionic (Ionic CLI) : 4.0.0
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 6.3.0
Cordova Platforms : android 7.0.0
System:
Android SDK Tools : 26.1.1
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 2.15.12
OS : Windows 10
Environment:
ANDROID_HOME : C:\Users\lars\AppData\Local\Android\Sdk
Android Studion is up 2 date...
How can I get rid of that error?
Many Thanks

ionic 3 ios can't find sourcemaps and banner not clickable

Anyone's facing the same issues?
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/plugins/cordova-plugin-admob-free/www/admob.js.map
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/polyfills/promise-7.0.4.min.js.map
Banner shows but not clickable.
Interstitial works perfectly.
$ ionic info
✔ Gathering environment info - done!
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 6.3.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 18 other plugins)
System:
ios-deploy : 1.9.2
ios-sim : 5.0.6
NodeJS : v8.11.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b
Plugin conflicts with googlemaps in my case. See the workaround here.
https://github.com/ratson/cordova-plugin-admob-free/issues/283

Ionic Beta 10 iOS Build - You're trying to build for iosbut don't have the platform installed yet

I've been developing on a Windows computer for Android just fine, but once got my hands on a Mac Mini. Once I got the OS updated to El Capitan, XCode installed, and everything else (NodeJS, Ionic, etc.) I tried to do a build for iOS and the build breaks saying:
You're trying to build for iosbut don't have the platform installed yet.
My Ionic Setup is as follows:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.12.0
Xcode version: Xcode 7.3.1 Build version 7D1014
The error I get is as follows:
Running 'build:before' gulp task before build
[23:21:58] Starting 'clean'...
[23:21:58] Finished 'clean' after 65 ms
[23:21:58] Starting 'build'...
[23:21:58] Starting 'sass'...
[23:21:58] Starting 'html'...
[23:21:58] Starting 'fonts'...
[23:21:58] Starting 'scripts'...
[23:21:58] Finished 'scripts' after 74 ms
[23:21:58] Finished 'fonts' after 85 ms
[23:21:58] Finished 'html' after 95 ms
[23:21:59] Finished 'sass' after 1.11 s
[23:22:10] Finished 'build' after 12 s
[23:22:10] Starting 'build:before'...
[23:22:10] Finished 'build:before' after 7.64 μs
• You're trying to build for iosbut don't have the platform installed yet.
∆ Installing ios for you.
Installing cordova-plugin-device
Installing cordova-plugin-console
Installing cordova-plugin-whitelist
Installing cordova-plugin-splashscreen
Installing cordova-plugin-statusbar
Installing ionic-plugin-keyboard
Caught exception:
Error: Command failed: cordova plugin add --save cordova-plugin-device
Parsing /Users/esx/projects/xcatalyst%20mobile%20app/config.xml failed
Error: Unencoded <
Line: 2
Column: 2
Char: <
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
As a side note, I did have Node v6.?.? and Cordova v6.3.0 installed, but there where issues where Cordova CLI showed up as Not Installed when executing "ionic info".
I've also tried to execute "ionic state reset" but get a similar error:
Removed platforms and plugins
Attempting to restore your Ionic application from package.json
Restoring Platforms
cordova platform add ios
cordova platform add android
Restore platforms is complete
Restoring Plugins
cordova plugin add cordova-plugin-whitelist
Caught exception:
undefined
This is my first attempt using a Mac and trying to build an Ionic app using one. I've followed (or tried to) the setup information on the Ionic site (OSX Setup).
I'm unsure of how to track either of these errors down.
Thanks in advance for any help.
The issue was in my config.xml, which had some invalid characters and syntax issues. I guess when building for the android platform this didn't matter, but it did/does for iOS builds.

Resources