iOS + Jenkins + git + Archive - ios

I use the Jenkins iOS Archive.
The jenkins project Console Output:
/bin/sh -c /Users/Shared/Jenkins/Home/jobs/YouKuHD/workspace/frameworks/download/build/DownloadManager.build/Debug-iphoneos/DownloadManager.build/Script-DB597F9F14DFD58700CDF0E3.sh
Could not find iphoneos in /Users/Shared/Jenkins/Home/jobs/YouKuHD/workspace/build
Command /bin/sh failed with exit code 1
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script build/DownloadManager.build/Debug-iphoneos/DownloadManager.build/Script-DB597F9F14DFD58700CDF0E3.sh
(1 failure)
Build step 'Xcode' marked build as failure
Finished: FAILURE
My project files:
iPad28/frameworks/download/DownloadManager.xcodeproj
iPad28/frameworks/youku.coreYouku.xcodeproj
iPad28/ipad/YouKuHD.xcodeproj
Xcode configuration:
Advanced Xcode build options
Xcode Project File
ipad/YouKuHD.xcodeproj
What should I do?
I make a test project also failed
The following build commands failed:
Check dependencies
(1 failure)
Build step 'Xcode' marked build as failure
Finished: FAILURE
What should I do?

Related

IOS - Running script '[CP-User] Generate Specs The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs In Azure Pipeline

I am working with the azure pipeline for CICD for React native app. I am using macOS Big Sur (11.4) and Xcode 12.4 as a local machine to create and test the app. App working fine on the local machine without any warning or issue for ios. However, when I am pushing the code on the Azure pipeline it is giving me errors as below,
2021-07-27T07:16:59.6470190Z ▸ Building library libRCTTypeSafety.a
2021-07-27T07:17:00.2028870Z ▸ Running script '[CP-User] Generate Specs'
2021-07-27T07:17:01.2282870Z ** BUILD FAILED **
2021-07-27T07:17:01.2284310Z
2021-07-27T07:17:01.2284960Z
2021-07-27T07:17:01.2285770Z The following build commands failed:
2021-07-27T07:17:01.2288070Z PhaseScriptExecution [CP-User] Generate\ Specs /Users/runner/Library/Developer/Xcode/DerivedData/QualityGateTest-fpifffctlauicvdetlisjqinofwg/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/FBReactNativeSpec.build/Script-650A047D1ACF74FC1AD8108A78938588.sh
2021-07-27T07:17:01.2289360Z (1 failure)
2021-07-27T07:17:01.2705660Z ##[debug]success of first tool:false
2021-07-27T07:17:01.2787820Z ##[debug]rc:0
2021-07-27T07:17:01.2788560Z ##[debug]success:true
2021-07-27T07:17:01.2807190Z ##[debug]task result: Failed
2021-07-27T07:17:01.2844600Z ##[error]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2856630Z ##[debug]Processed: ##vso[task.issue type=error;]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2866680Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2867800Z ##[debug]Agent.Version=2.189.0
My observation is that the Azure pipeline does not have macOS Big Sur as Agent. My local machine changes some configurations during POD install and adds the script to support the latest Xcode and macOS and the azure pipeline agent does not support macOS Big Sur reason it is not able to execute the script.
NOTE: I have tried all clean processes like yarn, pod, or delete node_module.
[azure-devops]
I have got the solution for the issue.
Actually, the latest version of macOS Big Sur (11.4) was not having a node install on VM.
A) I did some changes in the pipeline.
pool:
vmImage: macOS-11
steps:
- checkout: self
persistCredentials: true
clean: true
- task: NodeTool#0
displayName: 'Install Node'
inputs:
versionSpec: 'v16.6.2' # you can use your desired version here
- script: yarn install
displayName: Install Dependencies
B)
Also created patch inside react native lib for version 0.64. by adding "unset PREFIX" on node_modules/react-native/scripts/find-node.sh

Jenkins return "unknown error -1=ffffffffffffffff" when building Xcode Project with Cocoapods

I'm getting below error when trying to build Xcode workspace on Jenkins
usr/bin/codesign --force --sign B5E96BDFADAF51D771B158A29BF1D16565215A2D --preserve-metadata=identifier,entitlements '/Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework'
16:06:07 /Users/servicebuild/Desktop/Jenkins/workspace/Hello-Branch/build/Hello Test.app/Frameworks/Alamofire.framework: unknown error -1=ffffffffffffffff
16:06:07 Command /bin/sh failed with exit code 1
16:06:07
16:06:07 ** BUILD FAILED **
16:06:07
16:06:07
16:06:07 The following build commands failed:
16:06:07 PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/servicebuild/Library/Developer/Xcode/DerivedData/Hello-dcvxwbnovymfusbrvfyyekingznu/Build/Intermediates.noindex/Garanti\ Filo.build/Release-iphoneos/Hello\ Hello\ Test.build/Script-2617FEF7DE193736656550249B.sh
I have more than one targets and in workspace scheme targets that I created are ticked as shared (not the pod targets). In pod project every framework has "Don't Code Sign" (As Default). I can successfully get IPA export from Xcode. However, when I try to build in Jenkins I get this error.
I tried solution in below post but can't figure out. I think the problem is Jenkins is forcing to sign pods when It doesn't need to.
Codesign returned unknown error -1=ffffffffffffffff
I figured out how to run below code (posted in the post added in my question) and it worked. Important point is that giving right path for keychain and password. Otherwise, It doesn't work.
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ${KEYCHAIN}

Jenkins can not run build Script

My Jenkins job set for an IOS Project clones (fetches) the code from Bitbucket but fails to run one of the last scripts for building the Xcode project.
The script is called.I get the following error it really does not mean a lot for me.
Has anyone had a similar problem.I am pretty sure that there is something wrong with the project settings since other jobs in the jenkins run perfect.
PhaseScriptExecution Run\ Script
/Users/jenkins/Library/Developer/Xcode/DerivedData/myApp-Workspace-doqiapyymubizteljhyzayqxdtyk/Build/Intermediates/Target.build/Release-iphoneos/Target.build/Script-334A8A5117785D7D001DC5DA.sh
cd "/Users/Shared/Jenkins/Home/workspace/myApp - BETA"
/bin/sh -c /Users/jenkins/Library/Developer/Xcode/DerivedData/myDriveriOSDriver-Workspace- doqiapyymubizteljhyzayqxdtyk/Build/Intermediates/Driver.build/Release-iphoneos/Driver.build/Script-334A8A5117785D7D001DC5DA.sh
fatal: Not a git repository: '/Users/Shared/Jenkins/Home/workspace/myApp - BETA/../.git'
VERSION: 2.1.3.0
2014-01-24 13:54:29.529 defaults[61460:507] Unexpected argument Driver; leaving defaults unchanged.
Command /bin/sh failed with exit code 1
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/jenkins/Library/Developer/Xcode/DerivedData/myApp- Workspace-doqiapyymubizteljhyzayqxdtyk/Build/Intermediates/Target.build/Release-iphoneos/Target.build/Script-334A8A5117785D7D001DC5DA.sh
(1 failure)
The mentioned script sets some environment variables before the fatal error including;
...
setenv YACC yacc
setenv arch armv7s
setenv variant normal
There is a clear error in the log:
fatal: Not a git repository: '/Users/Shared/Jenkins/Home/workspace/myApp - BETA/../.git'
By analyzing your error log I guess that problem is in following statement
cd "/Users/Shared/Jenkins/Home/workspace/myApp - BETA"
instead try
cd "/Users/Shared/Jenkins/Home/workspace/myApp\ -\ BETA"
hope it helps

cordova mail plugin for ios stopped working

I'm using this plugin https://github.com/katzer/cordova-plugin-email-composer for composing a mail. But it suddenly stopped working and then I removed it. After adding it back when running cordova build ios it trows this error:
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.** BUILD FAILED **
The following build commands failed:
Ld build/device/app.app/app normal armv7
(1 failure)
** BUILD FAILED **
The following build commands failed:
Ld build/emulator/app.app/app normal i386
(1 failure)
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)
Do you now how to fix this?
I tried changing cordova version to 3.0,3.1,3.2 but it still doesn't work(all other plugins work just fine).
If I add plugins before cordova build build passes but email plugin still doesnt work.

BuildHive Jenkins build error

I'm trying to use Cloudbees' BuildHive service to build my GitHub-hosted project - bkemu-android. This is android-maven-plugin controlled project, so Jenkins job was created using "Maven job" template. But project build is just failing constantly with some obscure log message:
Parsing POMs
[bkemu-android] $ /usr/bin/tenant-isolate /opt/jdk/jdk1.6.latest/bin/java -XX:MaxPermSize=128m -cp /scratch/jenkins/maven3-agent.jar:/opt/maven/latest/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /opt/maven/latest /scratch/jenkins/slave.jar /scratch/jenkins/maven3-interceptor.jar 52322
setup process failed (1): Success
ERROR: Failed to launch Maven. Exit code = 1
What I should change in my project or BuildHive job settings to successfully build my project?

Resources