phonegap / phonegap-cli

PhoneGap and PhoneGap/Build command-line interface
Apache License 2.0
489 stars 157 forks source link

Code Sign Error on phonegap run ios #498

Closed seanwash closed 9 years ago

seanwash commented 9 years ago

Hey hey,

I've googled looking for a solution to this, to no avail. When trying to run phonegap run ios I receive the following error:

[phonegap] executing 'cordova run ios'...
Running command: /Users/seanwashington/Sites/onstrategy-mobile/platforms/ios/cordova/run

Build settings from command line:

    ARCHS = armv7 armv7s arm64
    CONFIGURATION_BUILD_DIR = /Users/seanwashington/Sites/onstrategy-mobile/platforms/ios/build/device
    SDKROOT = iphoneos8.1
    VALID_ARCHS = armv7 armv7s arm64

Build settings from configuration file '/Users/seanwashington/Sites/onstrategy-mobile/platforms/ios/cordova/build.xcconfig':
    CODE_SIGN_IDENTITY = iPhone Developer

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET OnStrategy Mobile OF PROJECT OnStrategy Mobile WITH CONFIGURATION Debug ===

Check dependencies

Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found.

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1'

** BUILD FAILED **

The following build commands failed:
    Check dependencies

(1 failure)

Error: /Users/seanwashington/Sites/onstrategy-mobile/platforms/ios/cordova/run: Command failed with exit code 65
    at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I tried following this advice as well, but no dice.

Any suggestions?

mwbrooks commented 9 years ago

@shazron would you mind taking a look at this. It may be as simple as installing ios-sim but I'm unsure how to recreate the issue.

seanwash commented 9 years ago

@mwbrooks Thanks for labeling this as a question.

Also, I do have ios-sim installed:

λ Seans-MacBook-Pro onstrategy-mobile → λ git master* → ios-sim --version
3.1.1
shazron commented 9 years ago

I'm not sure but I think it's trying to build the app for the device, which requires a valid signing cert. Try cordova run ios --emulator?

mwbrooks commented 9 years ago

fyi, phonegap run ios --emulator will do the same as cordova run ios --emulator.

seanwash commented 9 years ago

I removed the ios patform, readded and ran phonegap run ios --emulator and I get the same code signing error.

shazron commented 9 years ago

I tried with a new project using both the latest of the cordova and phonegap cli tools, and I couldn't repro. If using --emulator built it for device as well, the platforms/ios/build/device folder would have been created, which does not exist for me.

Sean - what version of the phonegap CLI are you using? phonegap --version

seanwash commented 9 years ago

4.1.2-0.22.9

alienpavlov commented 9 years ago

Faced the same problem. Googled only http://stackoverflow.com/questions/22440346/unable-to-run-phonegap-ios-app but they suggest to downgrade ios-sim to 1.8.0 and this is will not work for Xcode 6. Also tried to get ios-sim from npm, brew and clone from git but nothing helps.

OS X 10.10.1 Phonegap 4.1.2-0.22.10 ios-sim 3.1.1

alienpavlov commented 9 years ago

I've found a solution that works for me. I had wrong access rights for cordova, so "sudo chown -R USERNAME:staff .cordova/" helped me and everything works fine now. I hope that solution will help you as well.

l4zl0w commented 9 years ago

Same issue. OS X 10.10.1 Cordova 4.1.2 Xcode 6.1

The access rights for cordova did not help. :(

mwbrooks commented 9 years ago

@alienpavlov thanks for the fix suggestion!

@l4zl0w what ios-sim version are you using?

alienpavlov commented 9 years ago

@l4zl0w probably you're using outdated version of ios-sim. When I install it from brew it downloads 3.0.0 version, but then I've uninstalled it and clone from git:

$ git clone git://github.com/phonegap/ios-sim.git $ rake install prefix=/usr/local/

and after that I got 3.1.1, and then I've fixed right access issue

shazron commented 9 years ago

ios-sim only supports npm install (brew takes too long for approval, etc). In an upcoming 4.x release, ios-sim will be a Javascript shim over an Xcode tool (no C code).

Looks like someone from the community has been updating brew, can't vouch for it: https://github.com/Homebrew/homebrew/commits/799f5970ada803452943f7421f5e6a6e66ee9112/Library/Formula/ios-sim.rb

seanwash commented 9 years ago

Hey all, fwiw I just tried phonegap run ios --emulator and it worked this time.

Cheers!

mwbrooks commented 9 years ago

@seanwash awesome!