8
votes
  1. create new project
  2. build for iOS: SUCCESS
  3. add media plugin
  4. build for iOS: FAIL

The following build commands failed: CompileC build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Objects-normal/i386/CDVSound.o HelloWorld/Plugins/org.apache.cordova.media/CDVSound.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) [error] /Projects/Code/hello/platforms/ios/cordova/build: Command failed with exit code 65

Here's the list of commands

phonegap create hello
cd hello
phonegap build ios   # WORKS
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
phonegap build ios   # FAILS

Same scenario happens with cordova, and if I use sudo.

5
Do you have this problem when doing it for Android? I tried with Android and Cordova 3.4.0-0.1.3 without any issues. Strange to think that iOS version of media plugin requires the File plugin but the Android version doesn't. Also FWIW you can do cordova plugin add org.apache.cordova.media instead of typing the git url each time. You can find these names by typing cordova plugin search media for example. (Replace "cordova" with "phonegap" if you use pg.)MBillau

5 Answers

17
votes

I fixed the problem by completely deleting the iOS folder under platforms, then re-running phonegap build ios.

3
votes

This is something I ran into a while back. If you’re not an iOS developer, but get tasked with building iOS apps, you may run into this. This particular exit code is fun because xcodebuild doesn’t tell you what the problem is.

Aside from building your app using the Xcode IDE, you also have the command line utility xcodebuild available to you. Assuming the code itself compiles just fine, this tool will tell you, for example, if you’re missing a provisioning profile or something.

In my case, it turned out xcodebuild didn’t have access to the certificate I was using. So… here’s some things to check for:

  • Make sure you’ve installed an up to date certificate in your Keychain
  • Remove expired certificates
  • Grant access to xcode to use your certificate (or allow all programs to use the certificate)
  • Make sure you’ve installed an up to date provisioning profile
  • Remove expired provisioning profiles

Another option ....

use https://build.phonegap.com which will build the app for you and generate your .ipa and .apk files. It is free for 1 project (just delete your project and then re-upload if you have multiple ones). Just make an account, upload your certs and then you upload your www folder.

Thumbs up if you this was helpful to you!

3
votes

I got the solution on PhoneGap Google group

And the solution is to add the File plugin also. Strange that these dependencies are not mentioned but it worked. I guess we'll need to randomly try the combinations of plugins until something works.

The bug is logged here: https://issues.apache.org/jira/browse/CB-6225

And it looks like you have to add File plugin first, then Media, the order is important.

1
votes

try add sudo when add cordova plugin into your project.

sudo cordova plugin add https://github.com/apache/cordova-plugin-media
0
votes

I was getting an exit code 65 after adding the dialogs plugin. Tried some of the top answers here, but in the end James's advice worked: deleted the ios platform, reinstalled the platform, and then it built.