1

I'm working on a few updates for a Ionic app of which I've inherited the code, but while trying to build for iOS, I keep getting the below error. I've checked if the permissions are correct and search on Google and SO for answers but can't find any answers which apply to this case. Does anyone have any idea how to fix this?

The error:

The following build commands failed:
CompileC build/MM\ Coach.build/Debug-iphonesimulator/MM\ Coach.build/Objects-normal/i386/CDVInAppBrowser.o MM\ Coach/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Stefan/Sites/MMC/platforms/ios/cordova/build-debug.xcconfig,-project,MM Coach.xcodeproj,ARCHS=i386,-target,MM Coach,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Stefan/Sites/MMC/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Stefan/Sites/MMC/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/Stefan/Sites/MMC/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/Stefan/Sites/MMC/platforms/ios/cordova/build: Command failed with exit code 2

My versions:

Cordova CLI: 5.4.1
Ionic Version: 1.0.1
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.3 
ios-sim version: 5.0.4 
OS: Mac OS X El Capitan
Node Version: v4.2.4
Xcode version: Xcode 7.2 Build version 7C68 

I've also tried removing and adding the platforms again bij removing the platforms folder and with the "ionic platform remove ios" command.

Thanks in advance,

Stefan

Stefan
  • 53
  • 1
  • 6
  • Here is the solution guys !!! https://stackoverflow.com/questions/36095819/cordova-ios-error-building-images-xcassets/36968113#36968113 – gtzinos Sep 30 '16 at 12:45
  • Possible duplicate of [Cordova ios error building Images.xcassets](https://stackoverflow.com/questions/36095819/cordova-ios-error-building-images-xcassets) – BrunoLM Feb 02 '18 at 15:04

2 Answers2

1

I had the same problem, I fixed it by adding a provisioning profile to my app. You may need to (re)add it to your Ionic app. Although, I can't say for sure because I believe you haven't copied the complete error reason in your question (should be above it).

Adding a provisioning profile for your Ionic app:

If you haven't created them before check the iOS setup guide from Ionic.

Note that you need to have an Apple developer account.

  1. Generate a 'certificate signing request file' to authenticate the creation of an SSL certificate
  2. Create an iOS App ID at Apple Developer Center
  3. Optionally, configure the App ID for native features
  4. Create a provisioning profile at Apple Developer Center
  5. Check if the bundle identifier is correct in Xcode and config.xml
  6. For dev: $ ionic push --ios-dev-cert
ewdegraaff
  • 13
  • 3
  • I got an `Error logging in: Error: self signed certificate in certificate` error when I run `$ ionic push --ios-dev-cert` – RandomEli Aug 22 '16 at 20:29
0

The following works too:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Kurt Van den Branden
  • 11,995
  • 10
  • 76
  • 85