mobile ci on cloudbees jenkins and soasta cloudtest - jenkins

I'm following the practice outlined on this blog post in which an .ipa archive of my xcode project gets built on a slave by a CloudBees Jenkins job.
The slave now appears as a node in my Jenkins configuration and when the job is run, the xcode project is downloaded correctly from CloudBees. However, the job has a problem creating folders in /Applications/xcode.app. I could use some help troubleshooting the following stack trace:
Started by user Wil Pannell
Building remotely on mobile-slave in workspace /Users/WPANNELL/jenkins/workspace/ios-mobile-image-browser
Copied 275 artifacts from "gwt-mobile-image-browser" build number 3
Unable to access upstream artifacts area /home/ventana/hudson_home/jobs/gwt-mobile-image-browser/modules/com.ventana.gwt$mobilebrowser/builds/2013-01-07_20-08-56/archive. Does source project archive artifacts?
Working directory is /Users/WPANNELL/jenkins/workspace/ios-mobile-image-browser/ios/VentanaMobileBrowser.xcodeproj.
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/xcodebuild -version
Xcode 4.5.2
Build version 4G2008a
Fetching marketing version number (CFBundleShortVersionString) from project.
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/agvtool mvers -terse1
No marketing version found (CFBundleShortVersionString).
Marketing version (CFBundleShortVersionString) found in project configuration: .
Fetching technical version number (CFBundleVersion) from project.
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/agvtool vers -terse
No marketing version found (CFBundleVersion)
Technical version (CFBundleVersion) found in project configuration: .
Updating marketing version (CFBundleShortVersionString) to: 2.2.4
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/agvtool new-marketing-version 2.2.4
Setting CFBundleShortVersionString of project project to:
2.2.4.
/Applications/Xcode.app/Contents/Developer/usr/bin/agvtool: line 319: project.pbxproj/project.pbxproj.new1: Not a directory
mv: rename project.pbxproj/project.pbxproj.new1 to project.pbxproj/project.pbxproj: Not a directory
Updating technical version (CFBundleVersion) to: 2.2.4
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/agvtool new-version -all 2.2.4
Setting version of project project to:
2.2.4.
/Applications/Xcode.app/Contents/Developer/usr/bin/agvtool: line 139: project.pbxproj/project.pbxproj.new1: Not a directory
/Applications/Xcode.app/Contents/Developer/usr/bin/agvtool: line 140: project.pbxproj/project.pbxproj.new2: Not a directory
/Applications/Xcode.app/Contents/Developer/usr/bin/agvtool: line 141: project.pbxproj/project.pbxproj.new3: Not a directory
Also setting CFBundleVersion key (assuming it exists)
/Applications/Xcode.app/Contents/Developer/usr/bin/agvtool: line 145: project.pbxproj/project.pbxproj.new4: Not a directory
mv: rename project.pbxproj/project.pbxproj.new4 to project.pbxproj/project.pbxproj: Not a directory
rm: project.pbxproj/project.pbxproj.new1: Not a directory
rm: project.pbxproj/project.pbxproj.new2: Not a directory
rm: project.pbxproj/project.pbxproj.new3: Not a directory
Marketing version (CFBundleShortVersionString) used by Jenkins to produce the IPA: 2.2.4
Technical version (CFBundleVersion) used by Jenkins to produce the IPA: 2.2.4
Going to invoke xcodebuild:target: VentanaMobileBrowser, sdk: iphoneos, project: DEFAULT, configuration: Debug, clean: NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT
[VentanaMobileBrowser.xcodeproj] $ /usr/bin/xcodebuild -target VentanaMobileBrowser -sdk iphoneos -configuration Debug build DSTROOT=. clean install
Build settings from command line:
DSTROOT = .
SDKROOT = iphoneos6.0
xcodebuild: error: 'project.pbxproj' is not a project file.
Build step 'XCode' marked build as failure
Finished: FAILURE

My jenkins xcode configuration was incorrect. I specified the Xcode Project File in the field reserved for the Xcode Project Directory. I'll post back here if I encounter further problems.

Related

Not able to Run React native IOS App on new Xcode version 13

I have upgraded Xcode version13 .I started getting error trying to running ios app and the build always gets failed .
if I choose the option legacy build System it throws error :
The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
If I choose New Build System It throws error : **Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/Project-fqdjurlyjvhihgfubhiaayzhaadv/Build/Products/Debug-iphonesimulator/myproject.app/AntDesign.ttf':
Target 'Project' (project 'Project') has copy command from '/Users/username/Desktop/Project/employee-mobile-app/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to '/Users/username/Library/Developer/Xcode/DerivedData/Project-fqdjurlyjvhihgfubhiaayzhaadv/Build/Products/Debug-iphonesimulator/myproject.app/AntDesign.ttf'
That command depends on command in Target 'Project' (project 'project Name'): script phase “[CP] Copy Pods Resources”
**
what all I have tried :
deleted repo and cloned it again
did pod install again
removed some file from Build Phase => copy bundle Resource
Delete Drived data
Choose the option "Don not show a diagnostic issue about build system depreciation "

Can't build and run react-native project on Mac

Referring this issue, I've the same problem. I've MacOs El Captain on VMware.
Node v. 7.8.0
npm v.4.6.1
react-native-cli 2.0.1
react-native 0.46.4
Xcode v. 8.2.1
I've two issues:
- when trying to init a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I've execute npm install from Windows and then copied the node_modules folder on Mac.
- when trying to run the project on iOS simulator I recieve the following error:
** BUILD FAILED **
...
In file included from /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/Bits.h:70:
/Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/detail/BitIteratorDetail.h:21:10: fatal error: 'boost/iterator/iterator_adaptor.hpp' file not found
#include <boost/iterator/iterator_adaptor.hpp>
The following build commands failed:
CompileC /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/CaliUp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/CaliUp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist`
I really need to publish my app on the app store before the end of the week.
I've already try all suggested solutions but nothin works.
Could anyone help me?
First try this:
watchman watch-del-all && rm -rf node_modules
If you install node using Homebrew uninstall it and install node from here.(https://nodejs.org/en/)
Now if you used yarn to install node modules:
Try npm install
This error is caused by a failed third party library download in the build step. In your home folder there should be a ~/.rncache directory with a number of compressed C++ libraries. The error occurs when one or more of these files fails to download completely from the github amazon s3 servers. (likely in China)
The problem sticks around because the script in the react-native xcode build doesn't know how to resume the broken download. So you can fix this by deleting your ~/.rncache folder and because these folders are extracted into your modules you should also rm -rf node_modules and reinstall.
More info can be found here and here
May be this will work. Try these steps:
Backup your icons, images etc from ios folder.
Check that app name is set for key "name" in {project-root}\app.json file.
Delete ios/ and android/ directories
Run react-native eject
Replace the icons,images etc you copied earlier
Run react-native link
Launch you app from Xcode using short cut key command+r

xcodebuild: error: 'APP.xcworkspace' does not exist

I am trying to set up CI with gitlab. When I try to build locally, I get this error : xcodebuild: error: 'APP.xcworkspace' does not exist.
"APP" not being the real name. I am also using CocoaPods.
This happens after I run this command in terminal:
gitlab-ci-multi-runner exec shell build_project
I have checked and the file does exist in the same folder I call the command.
This is my .gitlab-ci.yml file:
stages:
- build
build_project:
stage: build
script:
- xcodebuild clean -workspace APP.xcworkspace -scheme APP | xcpretty
- xcodebuild test -workspace APP.xcworkspace -scheme APP -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2' | xcpretty -s
tags:
- v0.0.1
Xcode version: 8.2.1
Cocoapods version: 1.2.0
Gitlab-runner version : 1.11.0
Alex
On React Native I've solved this issue by running command inside /ios folder.
I have solved this now!!
I just had to update the cocoapods repo, se this link:
https://github.com/CocoaPods/CocoaPods/issues/5077
Looks like your specs repo was edited at some point, and now git can't update it. I'd recommend deleting and re-creating your Specs repo: pod repo remove master and running pod setup
In my case i had project with same folder name("Project") ending with 1 , 2 ,3 ,4 (total 5 folders). when i was trying to install cocoapods in "Project 4" Directory it was getting installed in "Project" instead it should be for "Project 4".
I could find Xcworkspace in the folder "Project"
Hence i need to delete other folders with same name and then install pods in "Project" folder
To share a scheme in Xcode:
Choose Product > Scheme > Manage Schemes.
Share your scheme:
Click on the Close button.

How to allow Jenkins to use usr/bin/security?

I'm building an iPhone app with Jenkins so at some point it needs to use /usr/bin/security. Unfortunately Jenkins can't find that command.
Here's the console log excerpt:
[workspace] $ /usr/bin/security find-identity -p codesigning -v FATAL: Cannot run program "/usr/bin/security" (in directory "/Users/jenkins/.jenkins/jobs/Obfuscated iOS/workspace"): error=2, No such file or directory java.io.IOException: Cannot run program "/usr/bin/security" (in directory "/Users/jenkins/.jenkins/jobs/Obfuscated iOS/workspace"): error=2, No such file or directory
Something like this typically means there is a permissions issue, so I have tried sudo chmod 777 /usr/bin/security but the build yields the same result.
Furthermore, when I try /usr/bin/security find-identity -p codesigning -v from terminal it works just fine.
How do I get Jenkins to be able to use this tool and any other iOS tools it might need?
More info:
The odd part is that other iOS related tools like /usr/bin/xcodebuild and /usr/bin/agvtool work fine as seen below:
[workspace] $ /usr/bin/xcodebuild -version
Xcode 6.4
Build version 6E35b
Fetching marketing version number (CFBundleShortVersionString) from project.
[workspace] $ /usr/bin/agvtool mvers -terse1
Found marketing version (CFBundleShortVersionString): 4.0.0.
Marketing version (CFBundleShortVersionString) found in project configuration: 4.0.0.
Fetching technical version number (CFBundleVersion) from project.
[workspace] $ /usr/bin/agvtool vers -terse
More on permissions:
ls -le yields
-rwxr-xr-x 1 root wheel 224032 Aug 1 20:43 security
This looks normal to me when compared to other tools in the same directory like xcodebuild.
Jenkins PATH
I checked the Jenkins System Configuration page and it lists this for PATH:
/usr/bin:/bin:/usr/sbin:/sbin
Running in a build step works!
If I create a new job with only a build step with the command, /usr/bin/security find-identity -p codesigning -v, then it runs fine.
This suggests that internally the command is being run by another process.
The problem was occurring because of the value used in "Build output directory":
Removing ${WORKSPACE} resolved the issue with calling /usr/bin/security.

List command hangs in xcode

I am using the Jenkins Xcode plugin (https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin) to build an iOS application, however it hangs when running the following command on a project I have inherited from another developer:
$ /usr/bin/xcodebuild -list
It also hangs when I run this command manually from a terminal. Does anyone know what the cause may be? The warning displayed is also displayed on another project I have, but it does not hang in this case.
Running Xcode 6.1 on OS X 10.10
$ /usr/bin/xcodebuild -list
2014-11-12 04:47:21.234 xcodebuild[42642:1431240] [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-6604/IDEFoundation/SourceControl/Model/IDESourceControlManager.m:423
Details: Error Domain=com.apple.dt.IDESourceControlErrorDomain Code=-1 "Missing extension: public.vcs.subversion" UserInfo=0x7f9792309200 {NSLocalizedDescription=Missing extension: public.vcs.subversion}
Object: <IDESourceControlManager: 0x7f9792302860>
Method: -loadRepositories
Thread: <NSThread: 0x7f9790d2dbe0>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Information about project "DOHSmokefree":
Targets:
DOHSmokefree
DOHSmokefreeTests
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
TLDR; My solution: Mark the schemes as shared in XCode if building them from the command line as a different user, or without ever opening XCode on the build machine.
I was having this same problem, intermittently on our CI server. I came across this question. The accepted answer with the problem being an issue and fixing the SVN version did not work for me as the SVN being used on the CI server was the default SVN and it was, as mentioned, working intermittently.
What I finally noticed is that, between a working version and a non-working version the schemes were not being listed. I had recently upgraded a library on the project and that got me to thinking about the schemes. After realizing that schemes are stored locally per user, unless shared, the fix for me was to go into the scheme manager and mark the schemes as shared.
The problem apparently being that the CI server user never actually opened the project in Xcode, thus causing the list command to hang because there were no available schemes for the user to build.
The times when it had intermittently worked were times after, logged in as the CI server user, I had opened the project in Xcode to test the build process, thus creating the necessary schemes. Wiping the CI server or refactoring/adding schemes would cause the build to break until the project was reopened in Xcode in desperation.
I had a similar issue when updating to Xcode 6.1 while using a newer version of subversion on the command line.
Disabling Source Control in Xcode Preferences should do the trick.
If that isn't an option you might try replacing the subversion implementation inside Xcode as I have done, using this technique: Use SVN 1.7 in XCode 4.3+
Basically that would be the following steps:
This assumes you already have SVN 1.7 installed to /opt/subversion, you can get it from WANdisco: http://www.wandisco.com/subversion/download#osx
Now open the Terminal and get an elevated shell using sudo -s.
Then, cd to inside the XCode.app package, to where the SVN binaries are.
Make a backup directory and move the old SVN files into it
bash-3.2# mkdir bup
bash-3.2# mv svn* bup/
Lastly, symbolically link the new files into the package:
bash-3.2# ln -s /opt/subversion/bin/svn* ./
That’s it!
I have the same problem on OS X 10.10 with XCode 6.4,just close XCode's Source Control to solved this issue:
run XCode
open Menu: XCode -> Preferences...
Click "Source Control" Tab and uncheck "Enable Source Control"

Resources