I am green to the iOS app development space. I need to setup a build in Jenkins for a new Swift application I built. As part of that, I used Cocoapods to manage dependencies which in turn, meant I now had a workspace instead of a simple project.
I'm now trying to build this application as part of our pipepline and have hit the following error:
FATAL: Since there are multiple projects in the workspace, you must be specify the location of the target project as Xcode Project File.
Build step 'Xcode' marked build as failure
Finished: FAILURE
The root of my project looks as follows:
$ ls -la
total 32
drwxr-xr-x 14 mcbint staff 448 15 Jan 15:16 .
drwxr-xr-x 3 mcbint staff 96 15 Jan 14:33 ..
drwxr-xr-x 13 mcbint staff 416 16 Jan 11:11 .git
-rw-r--r-- 1 mcbint staff 108 15 Jan 14:56 .gitignore
-rw-r--r-- 1 mcbint staff 501 15 Jan 14:56 Podfile
-rw-r--r-- 1 mcbint staff 379 15 Jan 14:56 Podfile.lock
drwxr-xr-x 9 mcbint staff 288 15 Jan 15:16 Pods
-rw-r--r-- 1 mcbint staff 666 15 Jan 14:56 README.md
drwxr-xr-x 10 mcbint staff 320 15 Jan 14:56 mcb-phoneagent-ios
drwxr-xr-x 5 mcbint staff 160 15 Jan 15:16 mcb-phoneagent-ios.xcodeproj
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-ios.xcworkspace
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosTests
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosUITests
drwxr-xr-x 2 mcbint staff 64 15 Jan 15:07 test-reports
I have setup the project in xcode as follows:
On my development machine I can successfully build the application with the command:
xcodebuild -workspace mcb-phoneagent-ios.xcworkspace -scheme mcb-phoneagent-ios
Does anybody see anything I've setup incorrectly?
This is how I resolved this issue when i ran into it:
Make sure that you have your scheme container set to the workspace (not the project. This can be checked in Xcode in Product -> Scheme -> Manage Schemes, then look in the column titled "Container")
confirm that the xcshareddata is in the workspace directory that Jenkins is using.
In Jenkins Under the General build settings of the Xcode there is a "Settings" button
click on it and find the Xcode schema file text box.
Fill that box in with the name of the xcsheme file you want to use for the given workspace that was entered as the Xcode Workspace file (in your case I'm guessing it would be mcb-phoneagent-ios).
Since you use Cocopod, you need to use the *.xcworkspace file, not the *.workspace,
and from personal experience much easier to archive and use *.app files with jenkins instead of letting it to build for u the projects
Related
I am trying to build/install the dependencies of a project called envoy.
The project directory looks like this:
$ ls -salt
total 176
0 drwxr-xr-x. 3 app app 37 Aug 31 13:06 ..
4 drwxrwxr-x. 16 app app 4096 Aug 4 02:28 .
0 drwxrwxr-x. 2 app app 23 Aug 4 02:28 .circleci
4 -rwxrwxr-x. 1 app app 259 Aug 4 02:28 .clang-format
0 drwxrwxr-x. 2 app app 22 Aug 4 02:28 .github
4 -rw-rw-r--. 1 app app 217 Aug 4 02:28 .gitignore
4 -rw-rw-r--. 1 app app 61 Aug 4 02:28 BUILD
4 -rw-rw-r--. 1 app app 433 Aug 4 02:28 CODEOWNERS
4 -rw-rw-r--. 1 app app 139 Aug 4 02:28 CODE_OF_CONDUCT.md
12 -rw-rw-r--. 1 app app 10993 Aug 4 02:28 CONTRIBUTING.md
4 -rw-rw-r--. 1 app app 1421 Aug 4 02:28 DCO
8 -rw-rw-r--. 1 app app 4221 Aug 4 02:28 DEPRECATED.md
4 -rw-rw-r--. 1 app app 2189 Aug 4 02:28 DEVELOPER.md
12 -rw-rw-r--. 1 app app 8202 Aug 4 02:28 GOVERNANCE.md
4 -rw-rw-r--. 1 app app 1718 Aug 4 02:28 ISSUE_TEMPLATE.md
12 -rw-rw-r--. 1 app app 11358 Aug 4 02:28 LICENSE
4 -rw-rw-r--. 1 app app 108 Aug 4 02:28 NOTICE
4 -rw-rw-r--. 1 app app 2923 Aug 4 02:28 OWNERS.md
4 -rw-rw-r--. 1 app app 2211 Aug 4 02:28 PULL_REQUEST_TEMPLATE.md
8 -rw-rw-r--. 1 app app 4844 Aug 4 02:28 README.md
8 -rw-rw-r--. 1 app app 6907 Aug 4 02:28 REPO_LAYOUT.md
16 -rw-rw-r--. 1 app app 13200 Aug 4 02:28 SECURITY_RELEASE_PROCESS.md
12 -rw-rw-r--. 1 app app 12085 Aug 4 02:28 STYLE.md
4 -rw-rw-r--. 1 app app 6 Aug 4 02:28 VERSION
4 -rw-rw-r--. 1 app app 514 Aug 4 02:28 WORKSPACE
4 drwxrwxr-x. 9 app app 4096 Aug 4 02:28 api
4 drwxrwxr-x. 3 app app 4096 Aug 4 02:28 bazel
4 drwxrwxr-x. 4 app app 4096 Aug 4 02:28 ci
4 drwxrwxr-x. 4 app app 4096 Aug 4 02:28 configs
4 drwxrwxr-x. 3 app app 4096 Aug 4 02:28 docs
4 drwxrwxr-x. 8 app app 4096 Aug 4 02:28 examples
0 drwxrwxr-x. 3 app app 18 Aug 4 02:28 include
0 drwxrwxr-x. 2 app app 41 Aug 4 02:28 restarter
0 drwxrwxr-x. 7 app app 70 Aug 4 02:28 source
0 drwxrwxr-x. 3 app app 50 Aug 4 02:28 support
4 drwxrwxr-x. 15 app app 4096 Aug 4 02:28 test
4 drwxrwxr-x. 6 app app 4096 Aug 4 02:28 tools
There are two bazel WORKSPACE files:
$ find . -iname WORKSPACE
./WORKSPACE
./ci/WORKSPACE
I guess I have to build the bazel native dependencies from the top directory, but i do not know how to specify the target BUILD file. Could you please advise on the bazel build
command to achieve that ?
EDIT: am trying to build what is mentioned in step#2 over here https://github.com/envoyproxy/envoy/blob/master/bazel/README.md
EDIT #2: when doing $ bazel build //source/exe:envoy
i get the following error
WARNING: /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule #com_github_grpc_grpc//:grpc_nanopb: please do not import '#com_github_grpc_grpc//third_party/nanopb:pb_common.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule #com_github_grpc_grpc//:grpc_nanopb: please do not import '#com_github_grpc_grpc//third_party/nanopb:pb_decode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule #com_github_grpc_grpc//:grpc_nanopb: please do not import '#com_github_grpc_grpc//third_party/nanopb:pb_encode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
ERROR: /home/app/.cache/bazel/_bazel_app/93cf2aaa5a193ee1dca34ebc2235b4f8/external/io_bazel_rules_go/proto/BUILD.bazel:21:1: no such package '#org_golang_x_net//context': failed to fetch org_golang_x_net: 2018/09/12 03:10:46 unrecognized import path "golang.org/x/net"
and referenced by '#io_bazel_rules_go//proto:go_grpc'
ERROR: Analysis of target '//source/exe:envoy' failed; build aborted: no such package '#org_golang_x_net//context': failed to fetch org_golang_x_net: 2018/09/12 03:10:46 unrecognized import path "golang.org/x/net"
INFO: Elapsed time: 73.577s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (253 packages loaded)
Could you please advise further ?
EDIT #3: For reasons of completeness, I run this under scl so that i have a more recent GCC version
- name: "Install envoy dependencies"
yum: name="{{ item }}" state=latest
with_items:
- cmake
- libtool
- libstdc++
- bazel
- centos-release-scl
- devtoolset-7-gcc-c++ # scl enable devtoolset-7 bash
environment:
http_proxy: "{{ prx.http }}"
https_proxy: "{{ prx.https }}"
meaning that I enter a shell by typing scl enable devtoolset-7 bash and then the usual stuff
From DEVELOPER.md, to build Envoy:
$ bazel build //source/exe:envoy
This //source/exe:envoy target is defined in source/exe/BUILD.
To run all tests:
$ bazel test //test/...
... refers to all targets, recursively.
To run a specific tests, e.g. async_client_impl_test defined in test/common/http/BUILD. //test/common/http is the package name.
$ bazel test //test/common/http:async_client_impl_test
You can run these commands from anywhere in the project directory because of // in the absolute target labels.
Can you try "go get -u google.golang.org/grpc" and see if it works?
I have a jenkins running a job, after which I want it to "archive artifact", which is basically just get some files.
The Job clones a github and when ran, it generates some log files which I need.
The patter is:
logfiles/*
I added a command to list the directory to make sure the files are there, and indeed they are.
+ ls -la logfiles
total 24
drwxr-xr-x 2 root root 4096 Apr 22 23:23 .
drwxr-xr-x 8 root root 4096 Apr 22 23:23 ..
-rw-r--r-- 1 root root 0 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41.log
-rw-r--r-- 1 root root 1248 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_shortmsg.csv
-rw-r--r-- 1 root root 2521 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_stats.log
-rw-r--r-- 1 root root 8035 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_trace_msg.log
Archiving artifacts
ERROR: No artifacts found that match the file pattern "logfiles/*". Configuration error?
ERROR: ‘logfiles/*’ doesn’t match anything, but ‘*’ does. Perhaps that’s what you mean?
Build step 'Archive the artifacts' changed build result to FAILURE
I don't really understand why they are not found.
Hope someone can help!
Thanks!
I finally found my problem. I had configured the job to do the git clone. But for some reason I also added the cloning on the build steps... once i removed that jenkins started getting the files properly.
I would still like to understand why this would happen...
Thanks to all
I'm trying to build the Android Support Testing project. I'm following these instructions. I've got my build env setup and I've synced the Repo. When I try to build the project I get this error.
$ pwd
/Volumes/android/android-support-test
$ ls -l
-r--r--r-- 1 me staff 87 Feb 5 12:56 Makefile
-rw-r--r-- 1 me staff 749 Feb 5 16:14 android-support-test.iml
drwxr-xr-x 11 me staff 374 Feb 5 12:56 build
lrwxr-xr-x 1 me staff 31 Feb 5 12:57 build.gradle -> frameworks/testing/build.gradle
drwxr-xr-x 16 me staff 544 Feb 5 12:57 external
drwxr-xr-x 4 me staff 136 Feb 5 12:57 frameworks
drwxr-xr-x 3 me staff 102 Feb 5 16:14 gradle
-r-xr-xr-x 1 me staff 5884 Feb 5 12:57 gradlew
lrwxr-xr-x 1 me staff 35 Feb 5 12:57 local.properties -> frameworks/testing/local.properties
drwxr-xr-x 3 me staff 102 Feb 5 16:17 out
drwxr-xr-x 7 me staff 238 Feb 5 12:57 prebuilts
lrwxr-xr-x 1 me staff 34 Feb 5 12:57 settings.gradle -> frameworks/testing/settings.gradle
$ ./gradlew assembleDebug
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/2.5/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* Where:
Build file '/Volumes/android/android-support-test/frameworks/testing/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating root project 'android-support-test'.
> Could not read script '/Volumes/android/android-support-test/version.gradle' as it does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.31 secs
The version.gradle file is in /Volumes/android/android-support-test/frameworks/testing but build.gradle is looking for it in /Volumes/android/android-support-test.
I think the aliasing of build.gradle -> frameworks/testing/build.gradle is not working correctly. Am I missing something?
The frameworks/testing Repo project should have contained an additional sym link, but you can just create it yourself:
ln -s frameworks/testing/version.gradle version.gradle
h/t to John Lombardo on the Android Testing Support Library google group
I saw this question, but I am still unable to import a framework and use it inside Xcode 7 beta 2 (7A121l).
So currently I am trying to use Result, via carthage. After adding it to Build Phases/ Link Binary with Binaries and Embed Frameworks I am able to compile successfully, but I get an error stating (yes it says success and then error :S):
No such module 'Result'
On the import:
import Result
func serverRequest() -> Result<String, NSError> {
...
}
The build is able to Run and Compile, but I am not able to cmd+click on Result, for example.
Edit 1:
On Xcode 6.3.2 it works as expected.
Edit 2:
Opened a radar: 21588771
Neil's answer is right, but there a very subtle difference how you set the FRAMEWORK_SEARCH_PATHS. So after adding it only to Build Phases/ Link Binary with Binaries, my initial setup was like this:
drwxr-xr-x 8 ruiperes staff 272 29 Jun 08:35 Playground
drwxr-xr-x 5 ruiperes staff 170 29 Jun 22:08 Playground.xcodeproj
drwxr-xr-x 4 ruiperes staff 136 29 Jun 00:12 PlaygroundTests
drwxr-xr-x 4 ruiperes staff 136 29 Jun 00:12 PlaygroundUITests
drwxr-xr-x 8 ruiperes staff 272 29 Jun 08:42 Result.framework
FRAMEWORK_SEARCH_PATHS = $(SRCROOT)/**
The above is the wrong setup and won't work. The working one below:
drwxr-xr-x 4 ruiperes staff 136 29 Jun 22:07 Frameworks
drwxr-xr-x 8 ruiperes staff 272 29 Jun 08:35 Playground
drwxr-xr-x 5 ruiperes staff 170 29 Jun 22:08 Playground.xcodeproj
drwxr-xr-x 4 ruiperes staff 136 29 Jun 00:12 PlaygroundTests
drwxr-xr-x 4 ruiperes staff 136 29 Jun 00:12 PlaygroundUITests
FRAMEWORK_SEARCH_PATHS = $(SRCROOT)/Frameworks/
You need to make sure that FRAMEWORK_SEARCH_PATHS in the xcodeproj includes the path where Result.framework is.
Im trying to follow a tutorial to do a CORBA assignment.
project
-Client/HelloClient.java
-Server/HelloServer.java
-Hello.idl
I do the first step, trying to compile the IDL (from the project root), and it fails.
$ idlj –td Client –fclient Hello.idl
com.sun.tools.corba.se.idl.InvalidArgument: Invalid argument: –td.
java version "1.8.0_11"
$ ls -l
total 16
drwxr-xr-x 3 juliusskye staff 102 Oct 28 20:14 Client
-rw-r-----# 1 juliusskye staff 85 Oct 28 17:49 Hello.idl
drwxr-xr-x 3 juliusskye staff 102 Oct 28 17:52 Server
-rw-r--r-- 1 juliusskye staff 425 Oct 29 13:45 idljintro.iml
drwxr-xr-x 2 juliusskye staff 68 Oct 29 13:45 src
I found this which says CORBA has problems parsing paths with / in front. But mine doesn't have a /
apparently the Lecturer's instructions were wrong or outdated or the compiler is not fully working but compilation of all files is achieved by
idlj -fall hello.idl