0

I'm trying to build my app using xcodebuild command in the terminal. It's failing to do so however, and giving me this error:

CodeSign build/Release-iphoneos/frameworkname.framework
    cd /path/frameworkname
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin"

Signing Identity:     "my signing identity"
Provisioning Profile: "provisioning profile"
                      (numbersandletters)

/usr/bin/codesign --force --sign numbersandletters /path/frameworkname/build/Release-iphoneos/frameworkname.framework
/path/frameworkname/build/Release-iphoneos/frameworkname.framework: bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1

** BUILD FAILED **

The following build commands failed:
    CodeSign build/Release-iphoneos/frameworkname.framework
(1 failure)

I'm using this command, while inside the project folder:

xcodebuild -target myprojectname -sdk iphoneos -configuration Release

Also tried adding -project myprojectname.xcodeproj but that doesn't make a difference, I still ge the same error.

I tried the script that was posted here but that didn't work for me either. I think it's because I don't have a Versions folder in my framework. That might be a place to start, but I don't know what to do tbh. Any help would be much appreciated :)

Community
  • 1
  • 1
Hafax
  • 369
  • 2
  • 14
  • Invalid framework structure might be a good idea to investigate. I'd try to compile it with `xctool` - messages are much clearer. – Opal Nov 24 '14 at 17:45

2 Answers2

1

Try to build like this:

security unlock-keychain -p aPassword /Users/aUser/Library/Keychains/login.keychain && \ 
xcodebuild -scheme 'aScheme' Release archive CODE_SIGN_IDENTITY="AcodeSignIdentity" PROVISIONING_PROFILE="aProvisioningProfile"

Especially note the

1) Keychain unlock (unnecessary if you can unlock from the gui)

2) The use of a scheme

Antzi
  • 12,831
  • 7
  • 48
  • 74
0

We found a solution that would build our project. We used this command

xcodebuild -project testerProject.xcodeproj -sdk iphoneos -configuration Release clean build RUN_CLANG_STATIC_ANALYZER=NO -scheme testerProject archive

Hafax
  • 369
  • 2
  • 14