Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] Failed to build SwiftGen

See original GitHub issue

Overview (Required)

  • Failed to build SwiftGen.

Steps To Reproduce

  1. Go to ios_base directory.
  2. Run make init
  3. Failed to build SwiftGen 6.1.0 with SPM

Expected behavior the build to be success.


  • OS: MacOS 10.15.3
  • Xcode 11.3.1
  • master branch / 2bedc70e496d3abc207754cd2a178e96b626d86e

Error Log

mint run swiftgen swiftgen
🌱  Using SwiftGen/SwiftGen 6.1.0 from Mintfile.
🌱  Cloning SwiftGen 6.1.0
🌱  Resolving package
🌱  Building package
[1/10] Compiling writer.c
[2/10] Compiling scanner.c
[3/10] Compiling reader.c
[4/10] Compiling parser.c
[5/10] Compiling emitter.c
[6/10] Compiling api.c
[7/11] Compiling Kanna CSS.swift
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:9: note: while building module 'libxml2' imported from /private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:
#import <libxml2/libxml/HTMLtree.h>
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "libxml/HTMLparser.h"
/Applications/ error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "libxml2-kanna.h"
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:9: error: could not build module 'libxml2'
#import <libxml2/libxml/HTMLtree.h>
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Sources/Kanna/CSS.swift:27:8: error: could not build Objective-C module 'libxmlKanna'
import libxmlKanna
'SwiftClibxml2' /private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/SwiftClibxml2: warning: system packages are deprecated; use system library targets instead
🌱  Encountered error during "swift build -c release -Xswiftc -target -Xswiftc x86_64-apple-macosx10.15". Use --verbose to see full output
🌱  Failed to build SwiftGen 6.1.0 with SPM
make: *** [swiftgen] Error 1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

nukka123commented, Jan 30, 2020

SwiftGen’s README said

Installation To install SwiftGen via Mint, simply use: $ brew install libxml2 $ mint install SwiftGen/SwiftGen

After installed libxml2 by manually, the SwiftGen build will succeed.

nukka123commented, Jan 30, 2020

@roana0229 thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode SwiftGen: build fails in project with multiple targets
I have a project with two targets (MyProject and MyProject Dev) which has SwiftGen integrated with Cocoapods. I can build the first target...
Read more >
SwiftGen Build Tool Plugin buildCommand issue in Xcode 13.3
I am trying to get SwiftGen working at a buildCommand Build Tool ... coach-ios/NoomOnboardingUI/SwiftGenPlugin/SwiftGenOutputs/Strings.swift ...
Read more >
Xcode Cloud is not able to access swift-gen generated file
I am using swiftgen as a prebuild command plugin in one of my internal swift ... When using Xcode cloud to build the...
Read more >
SwiftGen on
A collection of Swift tools to generate Swift code for your assets, storyboards, strings, …
Read more >
SwiftGen on iOS Dev Tools
SwiftGen is a tool to automatically generate Swift code for resources of your ... Starting with SwiftGen 6.2.1, if you get an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found