Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap local builds fail with media plugin

Tags:

ios

cordova

  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.

like image 450
Ska Avatar asked Mar 11 '14 17:03

Ska


3 Answers

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

like image 124
James Edmonston Avatar answered Sep 21 '22 14:09

James Edmonston


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!

like image 23
MGot90 Avatar answered Sep 21 '22 14:09

MGot90


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.

like image 37
Ska Avatar answered Sep 20 '22 14:09

Ska