openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
457 stars 127 forks source link

Upgrade to Sierra on jenkins build server - "Package" not working anymore #373

Closed boris-netural closed 2 years ago

boris-netural commented 6 years ago

Hello!

I have also a problem with packaging my app via Jenkins and the xcode-plugin. I used to have version 0.13.+ and now I have updated to MacOS Sierra on my build server and tried to use version 0.14.+, 0.15+ and also 0.15.1.develop.+

None of them is working.

I get the following error:

* What went wrong:
Execution failed for task ':package'.
> Command failed to run (exit code 1): '/usr/bin/codesign --force --sign iPhone Distribution: xxx --verbose /Users/jenkins/Home/workspace/xxx/xxx/build/package/Payload/xxx.app/Frameworks/iOSAboutApp.framework --keychain /Users/jenkins/Home/workspace/xxx/xxx/build/codesign/gradle-1512121741597.keychain'
  Tail of output:
  /Users/jenkins/Home/workspace/xxx/xxx/build/package/Payload/xxx.app/Frameworks/iOSAboutApp.framework: unknown error -1=ffffffffffffffff

What can I do or try? Is there something to consider after updating from El Capitan to Sierra. I had to upgrade to install Xcode 9.

Everything worked with the same projects, same jenkins setup, same gradle file before the upgrade to Sierra.

My gradle script is the following one:

buildscript {
    repositories {
        maven {
            url('http://repository.openbakery.org')
        }
        mavenCentral()
    }
    dependencies {
        classpath "org.openbakery:xcode-plugin:0.15.1.develop.+"
    }
}
apply plugin: 'org.openbakery.xcode-plugin'

xcodebuild {
    version = "9.1"
    target = 'xxx'
    scheme = 'xxx'
    workspace = 'xxx.xcworkspace'
    configuration = 'BETA'
    simulator = false
    type = 'iOS'
    signing {
        identity = 'iPhone Distribution: yyy'
        mobileProvisionURI = 'http://codesign/yyy/yyyInhouse2014.mobileprovision'
        certificateURI = 'http://codesign/yyy/yyyMobileCertificates.p12'
        keychainPassword = 'aaa'
        certificatePassword = 'bbb'
    }
    additionalParameters = "CACHEMANAGER=/Users/Jenkins/Home/workspace/CacheManager"
}

Thank you very much!

renep commented 6 years ago

I would guess that the identity at signing does not match. Remove the identity parameter.

xcodebuild {
    version = "9.1" // you only need to specify the version if you have multiple Xcodes installed and want to use a version that is not default
    target = 'xxx'
    scheme = 'xxx'
    workspace = 'xxx.xcworkspace' // You do not need this parameter if your project only contains one xcworkspace
    configuration = 'BETA'
    simulator = false
    type = 'iOS'
    signing {
        identity = 'iPhone Distribution: yyy' // Delete this parameter. It is not needed anymore. The Plugin take care that the proper identity is used. It is read from the p12 file.
        mobileProvisionURI = 'http://codesign/yyy/yyyInhouse2014.mobileprovision'
        certificateURI = 'http://codesign/yyy/yyyMobileCertificates.p12'
        keychainPassword = 'aaa'
        certificatePassword = 'bbb'
    }
    additionalParameters = "CACHEMANAGER=/Users/Jenkins/Home/workspace/CacheManager"
}
boris-netural commented 6 years ago

Hi René, thank you! This is not working for me. Nothing has changed. Error is still the same

renep commented 6 years ago

Very strange. I did some googling and it looks like a problem with the keychain. Normally the plugin takes create that the keychain setup is done propery. I also have Sierra installed on all my boxes and have never run in a similar issue. Can you run gradle on a different machine to rule out that your Build-Server is the problem.