CocoaPods : cmd-line builds - objective-c

It seems that in cmd-line builds, Pods don't get built automatically. Even when invoking xcodebuild to reference the workspace that declares how projects link to each other.
Is there a way to fix this, besides manually opening the project in Xcode and building?

I don't have any problem with such configuration: CocoaPods 0.28.0 and Xcode5 (+ Command-Line Tools) here and building using the Command-Line quite often (especially for Continuous Integration) without having any problem.
Neither with the Apple's xcodebuild command, nor with xctool (see also this NSHipster's article) when building my personnal project using Travis-CI either, everything works fine;
At work we have plenty of Xcode workspaces created using CocoaPods / pod install and we use Jenkins-CI to run xcodebuild to build them and no problem either.
Maybe you need to check a bit more about your configuration? Which CocoaPods & Xcode version, Which Command-Line Tools (xcode-select --print-path?), How is you Xcode configured (maybe you changed some of Xcode's default settings that broke it somehow)?
Tell us more about your specific configuration and the error/warning messages you got, because there should not be any problem.
Also make sure you have an up-to-date version of CocoaPods (some stuff were fixed some versions ago regarding Xcode5 and the new arm64 architecture, that broke implicit dependency detection in some cases)

Related

Xcode version problems. error:using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code

my iPhone just upgraded and now my iOS version is 15.3.1. Since my old version(12.4) of Xcode doesn't support that version of OS, I've installed newer version of Xcode(13.2.1). Now I cannot run my project and I got this error. I've changed Build Libraries for Distribution to NO and than my build is successful but when I set up breakpoint and start debagging I'm losing connection with debugger on my iPhone. Also I put device file(15.0) in /Aplications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport and in Supporting Files but it didn't
help. I will appreciate any help. Best regards.
Open your XCode,
Go to the Runner under PROJECTS -> search for 'distribution'
Make "Build Libraries for Distribution" to NO (if it is YES, change it to NO).
Do the same for Runner under TARGETS.
I also had the same problem I resolved it in this way.
Update:
Also don't forget to uncomment the following in iOS -> Podfile
platform :ios, '11.0'

The Podfile does not contain any dependencies with xcode

everybody, did you happen to encounter such an error while running the pod install command?
Link to the error itself
Since I tried to reinstall ruby by this method already:
rvm install ruby-2.6.3
rvm use ruby-2.6.3
rvm --default use 2.6.3
And still, unsuccessfully.
and cocoapods are also unsuccessful anyway, there is simply no place to look for an answer.
This error flies away only when working with an Obj-c project (and quite ancient ones), because I am now looking at the cryptoPro library and the standard project is not launched there.
There are no such problems with new projects at the moment.
Fixed an error. I will tell you what it was about me. I noticed this line in the bug:
untimeError - [Xcodeproj] Consistency issue: build setting ARCHS has multiple values: {"Debug"=>"$(ARCHS_UNIVERSAL_IPHONE_OS)", "Release"=>"$(ARCHS_STANDARD_32_BIT)"}.
After that I got into the Targets -> Build Settings -> Architectures project itself.
Specify there $(ARCHS_STANDARD) for both cases and then everything worked!

Bitcode signature failure in Xcode

I updated Xcode to the last version, and now when I'm trying to compile the project I'm getting an error "Invalid bitcode signature", hovewer, the bitcode for my project is disabled. How can I fix it? What should I change to sign my bitcode correctly?
My Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyProjectName' do
pod 'Realm'
pod 'CorePlot'
pod 'GoogleMaps'
end
I checked already, everything is fine with it.
I'm not sure if you have the same situation with me. I only have this issue when I tried to test with iPhone device. It turns out that the debug configuration with Build Active Architecture Only is set to NO. After I set to YES, I can test with my iPhone.
I experienced this error, but it happened only when building for an iOS 10.3 iPad (despite working on an iOS 10.3 iPhone and an iOS 11.0 iPad, and all the iOS 10.3 and 11.0 simulators). Through painful process of elimination (and creating a new project from scratch), I found that my Cocoapods weren't at fault, nor was my code signing settings, nor my AppExtension, nor my tests, nor my 'build for active architecture only' setting, nor any build setting related to the term 'bitcode'.
In my setup, I had a C++ Xcode project nested within my main Swift/iOS Xcode project. Because it was never intended specifically for use in iOS, the "iOS Deployment target" had never been set (it was left on 'default'). Upon setting it explicitly to 10.3, it worked without complaint.
Nested C++ app's project settings (set iOS deployment target to the lowest iOS version you support):
Nested C++ app's target settings (for reference):
If you using pod then please check the version of all libraries, some library may be not supporting in new version , you have to update pod files for that library.
In my case, I was trying to build for a device with an iOS version lower than the deployment target.
This kind of problem came up when I linked a new static library project to my workspace. In order to solve it I tried to set both the Build Active Architecture Only and the Bitcode settings of the library to NO but no luck. Then I got across the thing that the library's Deployment Target was set to 11.0 as Xcode set the latest value to all new projects. After fixing the setting to 5.0 the problem was solved.
On my case problem occured because of I was using a 3rd party static library with different files for each architecture
I fixed the problem by removing binaries of invalid architectures.
Instead I added a multi-arch FAT binary for the 3rd party static library
Hope helps
For my case, the solution was removing a c++ library.
I found that my issue was with using 'Modules'.
Just turned off modules (had to update some header files), but that resolved my issue.
Enable Modules In Settings
In my case, the widget included in the project was causing the bitcode error.
I changed my pod file from this:
target "App" do
pod 'A'
pod 'B'
end
target "App Widget" do
pod 'A'
end
to this:
target "App" do
pod 'A'
pod 'B'
target "App Widget" do
pod 'A'
end
end
To fix this issue, most answers recommend a workaround whereby you clean your Xcode workspace/project, close Xcode, delete your Derived Data folder (this is kept in the root directory of your project by default), then finally re-open your project.
However, the above steps may not work for you. This is a hint that your project structure is in error.
When the bitcode intermediary representation of your project was released with iOS 9.0, it was done so on the provision that your entire project, including dependencies, either totally agree to use bitcode or not. From my experience, it is vital to work through all of your Pods and included Libraries/Frameworks and ensure they all use the same setting; either Yes or No. By default, this selection is Yes.
If a single dependency does not match the intended bitcode setting, this error can be thrown.
When sanity checking your dependencies and overarching project, it is important to note that there is a Use Bitcode setting for both the Project and the Target settings, so be sure to check both perspectives of the Build Settings.
I was adding static library . I created fat binary of the same library including all architectures and included in my project. This resolved my issue
In my case, I am Using Cordova Project. While building it with Xcode had the same issue and Resolved by Removing and Adding the IOS platform.
cordova platform remove ios
cordova platform add ios
If you are using cocoa pods then do "pod update"
Targets -> Build Settings ->Build Active Architecture Only
Debug -> YES
Release -> NO to YES
I face the same problem only on archiving the app.
Who can tell me the reason? You can teach all developers. It's awesome.
This solution work for me. First, try to remove all pod using terminal command pod deintegrate and then reinstall pod using terminal command pod install.
This can also occur when building for the simulator if including a framework built for ARM only (and I assume vice-versa as well).

Multiple Xcode Installation

After a fresh install of Lion and Xcode 4.1 from the Mac App Store, I would like to install another version of Xcode alongside.
I heard that this perfectly safe to install it in another directory (considering the first to be on /Developer). The only thing to remember is that running xcodebuild would result in launching the last one installed.
But I have another issue while installing it, even f I changed the directory it clearly says that it will upgrade Xcode Toolset, System Tools and UNIX Development and that they can only be located is /Developer and for one installation per system, here is a screenshot :
So how to have another clean instance of Xcode and SDKs without screwing up the production one ?
Thanks a lot.
It doesn't seem to be possible to install the System Tools on both versions. I've never had success with that.
One thing to note, if you install an older version of xCode side-by-side with the latest version, the "Build Archive" function in the Organizer will not function. The only remedy I found was to remove both xCodes and reinstall the one I wanted to use for building the archive. It was a painful process.
Actually you can do this (or at least I seem to be able to). At times I have had three separate instances of XCode installed - an older XCode 3.x (which I've subsequently gotten rid of), an XCode 4 production, an XCode 5 beta; all in separate directories.
The key thing for me was calling the command line tool to tell which system is the "primary" xcode for the purposes of running xcodebuild, instruments, agvtool and a bunch of others: xcode-select -switch /Developer (just man xcode-select ftw).
So, I have a 4.0.2 build as primary now, and keep upgrading the iOS5 betas. I try them out, but when I want to cut a production build using 4.0.2, I ensure that my system knows that /Developer is current, switching it if I need to. FWIW, there is risk that the single-set-of-System-tools could be broken when you replace them with the latest set, but that's (so far) never hit me.
Also, for reference there is another discussion along similar lines here: Install xCode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs

compile wxWidget on Snow Leopard

I just downloaded wxWidget source code on my snow leopard machine. The source code is the multiplatform one, so it contains windows and GTK components of wxWidget as well. I'd like to compile the wxWidget source code, but haven't found a good guide yet.
This is my first step to create a multiplatform project, hopefully I would be able to use CMake to generate makefile later on.
Any help would be appreciated.
EDIT: Just to clarify, I'd like to build stable release of wxWidget on Snow Leopard, it would be building wxWidget 2.8.x on OS X 10.6.x. I have read the compiling wiki here http://wiki.wxwidgets.org/Development:_wxMac#Building_under_10.6_Snow_Leopard
Unfortunately, it didn't help.
I like using configure/make/make install:
./configure --enable-monolithic --enable-universal_binary --disable-shared --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk
make
sudo make install
I just tried this with wxWidgets 2.9.0 and it worked great.
The wxWiki is always a good place for guides, specifically the various OSX guides and the extra note here about compiling under 10.6.
It would also be good to note that there have been many changes between the current stable releases and the trunk, specifically much work has been done on a port to Cocoa.
Using CMake is pretty straight forward, just check the FindWxWidgets.cmake file in CMake for instructions, you can also check out the CMake docs (I would give the link but they don't seem to be up right now).