rayh/xcoder

Info.plist preprocessor not working

Closed this issue · 4 comments

I have set up Info.plist preprocessing using INFOPLIST_PREPROCESSOR_DEFINITIONS. It's working in Xcode, but when I try to build using xcoder, it's not preprocessing the Info.plist file so when it gets to code signing it says the bundle identifier doesn't match the provisioning profile.

My Rakefile was working before I enabled preprocessing.

From the terminal output (edited):

EXECUTE: xcodebuild -project "/Users/jim/foo/Foo.xcodeproj" -target "Foo" -config "Debug-Staging" -sdk iphoneos OBJROOT="/Users/jim/foo/build/" SYMROOT="/Users/jim/foo/build/" CODE_SIGN_IDENTITY="iPhone Developer: Jim Roepcke (foo)" PROVISIONING_PROFILE=foo

Any suggestions?

I figured out the issue - my Rakefile included these lines:

builder.profile = provisioning_profile
builder.identity = "iPhone Developer: #{BUILDER_IDENTITY}"

This was causing the provisioning profile to be one of the "Build settings from command line". During the "Check dependencies" phase, it was checking that the Info.plist's CFBundleIdentifier matched the profile's bundle identifier BEFORE preprocessing the Info.plist file.

Instead of passing in the provisioning profile via the command line, I set it directly on the project, and this eliminated the failing dependency check.

Hey @JimRoepcke, I'm also having this problem, but I'm not able to fix it like you were. I have just

builder.identity = "iPhone Developer: #{BUILDER_IDENTITY}

when using xcoder, and it's been working since we started doing it months ago. However, we now decided we wanted to preprocess our Info.plist so we can conditionally include our beta bundle identifier or release one, so our testers don't have the two apps install on top of each other. In our plist, we pretty much have

    <key>CFBundleIdentifier</key>
    <string>BUNDLE_IDENTIFIER</string>

then in our plist preprocessor file header file, we define

#define BUNDLE_IDENTIFIER com.some.bundle.identifier

It seems to work beautifully with the simulator, but as soon as it tries to code sign (ie, building an ipa for TestFlight) I see the same issue you had

       : Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates
       : ** BUILD FAILED **
       : The following build commands failed:
       : (1 failure)
       ! Captured output to /Users/marklar/programming/foo_bar/Build/xcoder-xcodebuild-20131009-231225
       ! Cropped 651 lines
       > Check dependencies
       > Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates
       >
       >
       > ** BUILD FAILED **
       >
       >
       > The following build commands failed:
       > Check dependencies
       > (1 failure)
/Users/marklar/.rvm/gems/ruby-1.9.3-p327@foo/gems/xcoder-0.1.18/lib/xcode/shell/command.rb:93:in `execute': Error (65) executing 'xcodebuild -sdk iphoneos -workspace "/Users/marklar/programming/foo_bar/foo_bar_ios.xcworkspace" -scheme "FooBar Beta" -configuration "Beta" OBJROOT="/Users/marklar/programming/foo_bar/Build/" SYMROOT="/Users/marklar/programming/foo_bar/Build/Products/" CODE_SIGN_IDENTITY="iPhone Distribution: Foo Bar, LLC"' (Xcode::Shell::ExecutionError)

Any insight would be awesome! Thanks

Sorry, I punted on it, but I haven't tried since upgrading to 5.0, maybe it's improved there?

Perhaps -- we're still on 4.x for some of our apps, though, because we aren't supporting iOS7 yet :(