'Jenkins pipeline failed to prepare xcodeBuild step
I created one free-style job for generating .ipa for one of my project. Its working fine and successfully generated .ipa file.
Now I want to create the same job with pipeline. So, I convert this free-style job to pipe line. But gives me error. Then I used pipeline syntax to generate script from my free-style job step by steps. But still it gives me an error.
I serched a lot for this but nothing helps. Also I tried to unlock keychain before xcode build steps start. But still same result.
It would be great if anyone help me to resolve my issue. Thank you.
Below is my pipeline script.
node {
stage(‘Code Fetch’) {
git branch: 'development', changelog: false, credentialsId: 'e7f0318c-0000-0000-0000-a5a3831b2274', poll: false, url: 'https://github.com/XXXXX/XXXXXXX.git'
}
stage("Installing pods") {
sh '/usr/local/bin/pod install'
}
stage("Build") {
sh '''security unlock-keychain -p apple /Users/xxxxxx/Library/Keychains/login.keychain-db
security set-keychain-settings -t 3600 -l /Users/xxxxxx/Library/Keychains/login.keychain-db'''
xcodeBuild appURL: '', assetPackManifestURL: '', buildDir: '', buildIpa: false, bundleID: '', bundleIDInfoPlistPath: '', cfBundleShortVersionStringValue: '', cfBundleVersionValue: '', cleanResultBundlePath: false, compileBitcode: false, configuration: 'Debug', copyProvisioningProfile: false, developmentTeamID: ‘XXXXXXXXX’, developmentTeamName: '', displayImageURL: '', fullSizeImageURL: '', generateArchive: true, ipaExportMethod: 'development', ipaName: ‘My’App, ipaOutputDirectory: 'artifacts', keychainId: '', keychainPath: '', keychainPwd: '', logfileOutputDirectory: '', provisioningProfiles: [[provisioningProfileAppId: 'com.myapp.app', provisioningProfileUUID: '955246fe-0000-0000-0000-cfa12fa742a7']], resultBundlePath: '', sdk: '', signingMethod: 'manual', symRoot: '', target: '', thinning: '', uploadBitcode: false, uploadSymbols: false, xcodeProjectFile: '', xcodeProjectPath: '', xcodeSchema: ‘MyApp’, xcodeWorkspaceFile: 'MyApp', xcodebuildArguments: ''
}
}
And the error I got from jenkins:
java.lang.ClassCastException: class au.com.rayh.XCodeBuilder.setKeychainPwd() expects class hudson.util.Secret but received class java.lang.String
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:492)
at org.jenkinsci.plugins.structs.describable.DescribableModel.injectSetters(DescribableModel.java:429)
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:331)
Caused: java.lang.IllegalArgumentException: Could not instantiate {appURL=, assetPackManifestURL=, buildDir=, buildIpa=false, bundleID=, bundleIDInfoPlistPath=, cfBundleShortVersionStringValue=, cfBundleVersionValue=, cleanResultBundlePath=false, compileBitcode=false, configuration=Debug, copyProvisioningProfile=false, developmentTeamID=XXXXXXX, developmentTeamName=, displayImageURL=, fullSizeImageURL=, generateArchive=true, ipaExportMethod=development, ipaName=MyApp, ipaOutputDirectory=artifacts, keychainId=, keychainPath=, keychainPwd=, logfileOutputDirectory=, provisioningProfiles=[{provisioningProfileAppId=com.MyApp.app, provisioningProfileUUID=955246fe-0000-0000-0000-cfa12fa742a7}], resultBundlePath=, sdk=, signingMethod=manual, symRoot=, target=, thinning=, uploadBitcode=false, uploadSymbols=false, xcodeProjectFile=, xcodeProjectPath=, xcodeSchema=MyApp, xcodeWorkspaceFile=MyApp, xcodebuildArguments=} for au.com.rayh.XCodeBuilder
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
at org.jenkinsci.plugins.structs.describable.UninstantiatedDescribable.instantiate(UninstantiatedDescribable.java:208)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:466)
at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:409)
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:329)
Caused: java.lang.IllegalArgumentException: Could not instantiate {delegate=@xcodeBuild(appURL=,assetPackManifestURL=,buildDir=,buildIpa=false,bundleID=,bundleIDInfoPlistPath=,cfBundleShortVersionStringValue=,cfBundleVersionValue=,cleanResultBundlePath=false,compileBitcode=false,configuration=Debug,copyProvisioningProfile=false,developmentTeamID=XXXXXXX,developmentTeamName=,displayImageURL=,fullSizeImageURL=,generateArchive=true,ipaExportMethod=development,ipaName=myapp,ipaOutputDirectory=artifacts,keychainId=,keychainPath=,keychainPwd=,logfileOutputDirectory=,provisioningProfiles=[{provisioningProfileAppId=com.MyApp.app, provisioningProfileUUID=955246fe-0000-0000-0000-cfa12fa742a7}],resultBundlePath=,sdk=,signingMethod=manual,symRoot=,target=,thinning=,uploadBitcode=false,uploadSymbols=false,xcodeProjectFile=,xcodeProjectPath=,xcodeSchema=MyApp,xcodeWorkspaceFile=MyApp,xcodebuildArguments=)} for org.jenkinsci.plugins.workflow.steps.CoreStep
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:302)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:499)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1172)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1172)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
Caused: java.lang.IllegalArgumentException: Failed to prepare xcodeBuild step
at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:501)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1172)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1172)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
at WorkflowScript.run(WorkflowScript:12)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
at jdk.internal.reflect.GeneratedMethodAccessor221.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
at jdk.internal.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:403)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:97)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:315)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:279)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Finished: FAILURE
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
