openbakery / gradle-xcodePlugin

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

EntitlementFile parameter causes Exception at packaging in 0.15.+" #372

Closed IntellectSoftDeveloper closed 6 years ago

IntellectSoftDeveloper commented 6 years ago

I use version 0.15.+ and on package step I have error: `FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':package'.

Cannot cast object \'file:///Users/user/Jenkins/workspace/ExOst/Build iOS app/iOS/gradle_signing/ExOst.entitlements\' with class \'java.lang.String\' to class \'java.io.File\'

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Get more help at https://help.gradle.org`

My build.gradle `buildscript { repositories { maven { url('http://repository.openbakery.org/') } mavenCentral() }

dependencies {
    classpath "org.openbakery:xcode-plugin:0.15.+"
}

}

apply plugin: "org.openbakery.xcode-plugin"

xcodebuild { target = 'ExOst' scheme = 'ExOst' configuration = 'Release' workspace = 'ExOst.xcworkspace' simulator = false type = 'iOS' signing { mobileProvisionURI = 'file:///Users/user/Jenkins/workspace/ExOst/Build iOS app/iOS/gradle_signing/AdHoc.mobileprovision' certificateURI = 'file:///Users/user/Jenkins/workspace/ExOst/Build iOS app/iOS/gradle_signing/Key.p12' certificatePassword = '****' entitlementsFile = 'file:///Users/user/Jenkins/workspace/ExOst/Build iOS app/iOS/gradle_signing/ExOst.entitlements' } infoplist { commands = [ 'Set :Server prod' ] } } `

Can`t find any solution, help plz

renep commented 6 years ago

can you add the --stracktrace when you run the command and add the stacktrace output here, so that I can see where this exception is thrown.

IntellectSoftDeveloper commented 6 years ago
panyibin commented 6 years ago

hey, is this issue resolved? I met exactly the same problem.

renep commented 6 years ago

can you try the latest develop version: Build: 0.15.1.122 see: https://github.com/openbakery/gradle-xcodePlugin/tree/develop#current-develop-version

panyibin commented 6 years ago

Hmm, I used the latest develop version, and it seems the issue still exists, the debug info is below. It works well in 0.14.5, but not in 0.15.1.develop.+.

:keychainCreate :provisioningClean :provisioningInstall :package FAILED :keychainRemove

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 9.503 secs

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.

renep commented 6 years ago

@boris-netural can you please create a new issue with you question, because your issue has nothing to do with the issue here. I would also suggest you checkout the examples, because the parameters have changed since 0.13. Also when you create a new issue and post your config, I have more information what is wrong.

renep commented 6 years ago

@panyibin I check if my build server has properly published the latest version. According to your stacktrace, your version contains not fix.

renep commented 6 years ago

Hmm... My builder server has properly published the version. Your build.gradle config should contain:

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"

Also, you can run gradle with --refresh-dependencies so that the plugin is downloaded again.

panyibin commented 6 years ago

Thanks, @renep, running "gradle with --refresh-dependencies" solves the problem, and the build script works correctly now.