no such module SWXMLHash while building SourceKitten - objective-c

I cloned SourceKitten from github and when I open the project in Xcode, I am not able to build
In class Clang+SourceKitten.swift, I am getting No such module SWXMLHash
I have tried running swift build and make install from command line, which works perfectly. But, I need to create my own custom command line tool (similar to sourcekitten) - for which I need to open project and should be able to build and run it.

Well, I needed to update the carthage and open xcworkspace and everything was fine.

Related

Xcode: weird build failure when duplicating a build configuration

I duplicated an existing build configuration in my Xcode project called Direct and named it Setapp.
I didn't modify anything regarding the new build config Setapp, however, when I build using the Setapp build config, I am getting an error.
It says the library Ensembles cannot be found. It's a library that I installed via Cocoapods.
I can't figure why I am getting this error. Since I am using an exact copy of a build configuration that works (Direct in this case), I don't see how Direct builds fine but Setapp doesn't.
Just as extra information, I am specifying to build using the Setapp build configure using Scheme like this:
Any ideas?
Turns out I need to run pod install again.

How to use "increment_build_number" in xcworkspace projects?

I am trying to automate my build process with fastlane in my react native project. I am following this article. In increment_build_number action I couldn't find any option to specify the .xcworkspace project. I tried using workspace tag, but didn't work.
The action does not have a workspace parameter: https://docs.fastlane.tools/actions/increment_build_number/#parameters
increment_build_number is more or less a wrapper for agvtool from Apple. That tool unfortunately only works on xcodeproj files: http://www.manpagez.com/man/8/agvtool/ You actually don't even specify the file, it looks for it in the folder you are executing the command in.
Which is also why increment_build_number only uses the xcodeproj parameter to change the directory before running the command: https://github.com/fastlane/fastlane/blob/04ef48fad041eb6c62e8015264df781d3bfc9983/fastlane/lib/fastlane/actions/increment_build_number.rb#L15-L21
You will probably have to modify your usage to specify the xcode project (that should exist next to the workspace anyway) or execute it in a way so the action can find it automatically.

How to build ROS2 based application from outside of workspace

I created a qt application which can be build by cmake. My application uses some ros2 service so I need to build it with ros. For that I need to put my code under ros2_ws/src/. I want to avoid this thing. I want to build by application from any folder ( without putting under ros2_wc) with ament tool. How can I do it ?
If you want to do that, you need to build ROS2 as usual, and source the following script:
. install/local_setup.bash
Then you can call your build command using ament from the directory you want.
cd <dir>
ament build --force-cmake-configure ...
For those who are using the new ros2 build tool: colcon
You can keep your own ~/ros2_ws, and put the QT application to another ~/ros2_overlay_ws.
For example, if your new QT application depends on some service or msg located in the original ~/ros2_ws, you could go to ~/ros2_ws and run colcon build.
After compile finished, please remember to import and re-index your packages by the following command: source ~/ros2_ws/install/setup.bash. This will re-index your ros2 packages at current terminal.
Now go to ~/ros2_overlay_ws/ and put your QT application to ~/ros2_overlay_ws/src and then run colcon build. colcon will find your indexed package and add them to your dependency.

Linker command failed with exit code 1 - duplicate symbol __TMRbBp

Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?
It seems to be a bug in Swift. See
discussion on Apple developers portal
It is said to be fixed in Xcode version that is about to be released.
But for now there is temporary workaround:
Go to your target Build Settings and set Reflection Metadata Level flag to None
Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.
File -> Close Workspace
File -> Open -> Search your project folder for Project.xcworkspace
All my errors are gone.
I faced the same problem with archiving on Xcode 8.1.
X Code Version: Version 8.2.1 (8C1002)
The following fix worked on Mar 2019
1) Go to Project & Select your Project
2) Select Build Settings -
Search for "Enable Bitcode" Set option as "NO"
3) Most of version will fix this issue, for few other XCode version try this option also,
Search for "Reflection Metadata Level" Set option as "NONE"
I had similar issues with Version 9.2 (9C40b), the solution is
0) Close Xcode
1) Open project folder in terminal
2) pod update
3) open .
4) open project by clicking Project.xcworkspace
Surprisingly, in some occasions, simply cleaning the product worked for me.
Product/Clean (Shift+Cmd+K)
Product/Clean Build Folder (Alt+Shift+Cmd+K)
Quick fix to try before looking at other solutions.
1.Close your project:Completely quit Xcode.
2.Go to your project location:there you will find two files in you root folder with varying extensions:
Appname.xcodeproj and Appname.xcworkspace
Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**
Yourproject will open in xcode.
Now run your project again.
If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods
firebaseIOS Setup
$ cd your-project directory
$ pod init
Add to Podfile
pod 'Firebase/Core'
And finally:
$ pod install
$ open your-project.xcworkspace
Dont forget to add firebase to your AppDelegate
If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.
The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+
It took me a couple of hours to figure this out!
In my case
Select your project (In my case i have 2 targets)
Go to Build Phases
Compile Sources
Check if the number of items on each targets is the same (mine was different)
Add the missing file / Remove the duplicated file
Problem Solved
I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.
Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"
Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.
close you project then open xcode go to file -> open search your project and open it . this worked for me
I got this error due to deletion of some files. For me simply cloning my project worked.
For those that can't get the Thorax's answer to work, what I did was I closed out Xcode, ran pod update on my command line and then reopened the .xcworkspace file. After doing that, I was able to build and run the project.
I am using the Firebase Cocoapod and Xcode version 9.1.
I had removed files from Compile Sources in Build Phases in Targets. I added main.m and it worked.
Had the same problem in Xcode 10.1 and was able to resolve it. In path Project Target > Build Setting > No Common Blocks, I changed it to No.
I had similar kind of problem when I added a framework to my project.
I have resolved the issue by removing the framework and again adding the framework to the project by dragging and dropping the framework file to the projects frameworks folder and selecting the Copy items if needed option.

compiling golang using intellij is looking for wrong path of 3rd party packages

I'm using IntelliJ with the go plugin to write my application.
version of Go: go version go1.7beta2 darwin/amd64
Operation system: OSX El Capitan 10.11.5
Intellij Version: 2016.1.3
Go Installation Location: /usr/local/go
Go Pkg Location ($GOPATH): /Users/ufk/projects/go
when I open terminal, browse to my application's main source file, and type go it compiles it properly without any errors.
but when I try to Run the program using Intellij, which also compiles it, i get the following error:
/usr/local/go/pkg/tool/darwin_amd64/link: cannot open file /usr/local/go/pkg/darwin_amd64/github.com/codegangsta/negroni.a: open /usr/local/go/pkg/darwin_amd64/github.com/codegangsta/negroni.a: no such file or directory
lookgs like it's looking for the negroni package in the location when I have go installed, and not where I the 3rd party packages are installed according to $GOPATH. My project is configured to use $GOPATH, and the real time error of the intellj editor doesn't complain about packages that are not installed which means that Intellij does check the $GOPATH variable.
so what am i missing ?
thanks
update
Hi :)
I noticed something new... I have 2 go projects, one of them is the JSON Api Server, and the other is for the web server.
The project that is causing issues is the Api Server.
now, the web server also uses and imports negroni, but the problem occurs only on the Api Server Project.
so I decided to go wild and delete the .idea and iml file from the Api Server, reopen it with intellij, and see what happens... welp, what happens is that now it complains about a different module.
/usr/local/go/pkg/tool/darwin_amd64/link: cannot open file /usr/local/go/pkg/darwin_amd64/github.com/jingweno/negroni-gorelic.a: open /usr/local/go/pkg/darwin_amd64/github.com/jingweno/negroni-gorelic.a: no such file or directory
the thing is.. that my web server project also uses negroni-gorelic and things are fine!
I tried downgrading go from 1.7beta2 to 1.6.2, deleting the content of the modules ($GOPATH/pkg and in src directory github.com and golang.org)
then I got all the modules again.. tried to compile with intellij and the results are the same.
so... hope this helps to further investigate the issue.