iOS Build Environment Help Center

Error building pods

append delete Rushan

Windows 10
iOS Builder Version 3.59
iOS SDK 17.0

Hey Pierre,
I have bought the iOS Project Builder for Unity and have been following the instructions in the help document. Every thing went smoothly however I need your help in the build step. There were two other forum posts with an error similar to mine but I could not manage to solve it. So I thought maybe the cause of my error was different or I missed something since I am relatively new to programming in general.

Here is the error I am getting and thank you for your time and your help:

These scripts might be non critical - attempting to proceed anyway.
Building the CocoaPods dependency project AFNetworking...
+ Preparing output directory...
+ XCFrameworks: 51 supplied
+ Libraries: 52 supplied, 0 built
+ Frameworks: 2 supplied, 0 built
+ Pre-parsing project files...
+ Building AFNetworking for iphoneos (configuration: Release)
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\AFAutoPurgingImageCache.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFHTTPSessionManager.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\AFImageDownloader.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\AFNetworkActivityIndicatorManager.m...
+ [arm64] Compiling Pods\AFNetworking\..\Target Support Files\AFNetworking\AFNetworking-dummy.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFNetworkReachabilityManager.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFSecurityPolicy.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFURLRequestSerialization.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFURLResponseSerialization.m...
+ [arm64] Compiling Pods\AFNetworking\AFNetworking\AFURLSessionManager.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\UIActivityIndicatorView+AFNetworking.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\UIButton+AFNetworking.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\UIImageView+AFNetworking.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\UIProgressView+AFNetworking.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\UIRefreshControl+AFNetworking.m...
+ [arm64] Compiling Pods\AFNetworking\UIKit+AFNetworking\WKWebView+AFNetworking.m...
While building module 'UIKit' imported from C:/Users/kolon/Documents/GameGRPL_iOS/GameiOS/Build/Pods//Target Support Files/AFNetworking/AFNetworking-prefix.pch:2:
While building module 'Foundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/UIKit.framework/Headers\UIKit.h:8:
While building module 'CoreFoundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/Foundation.framework/Headers\Foundation.h:6:
While building module 'Dispatch' imported from C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
In file included from C:\iOS\builder\SDK\usr\include\libxml2\module.modulemap:1:
C:\iOS\builder\SDK\usr\include\libxml2\libxml/module.modulemap(1,8): error: redefinition of module 'libxml2'
module libxml2 [system] {
^
C:\iOS\builder\SDK\usr\include\libxml\module.modulemap(1,8): note: previously defined here
module libxml2 [system] {
^
While building module 'UIKit' imported from C:/Users/kolon/Documents/GameGRPL_iOS/GameiOS/Build/Pods//Target Support Files/AFNetworking/AFNetworking-prefix.pch:2:
While building module 'Foundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/UIKit.framework/Headers\UIKit.h:8:
While building module 'CoreFoundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/Foundation.framework/Headers\Foundation.h:6:
While building module 'Dispatch' imported from C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
While building module 'os_workgroup' imported from C:\iOS\builder\SDK\usr\include\dispatch/dispatch.h:64:
In file included from C:\iOS\builder\SDK\usr\include\libxml2\module.modulemap:1:
C:\iOS\builder\SDK\usr\include\libxml2\libxml/module.modulemap(1,8): error: redefinition of module 'libxml2'
module libxml2 [system] {
^
C:\iOS\builder\SDK\usr\include\libxml\module.modulemap(1,8): note: previously defined here
module libxml2 [system] {
^
While building module 'UIKit' imported from C:/Users/kolon/Documents/GameGRPL_iOS/GameiOS/Build/Pods//Target Support Files/AFNetworking/AFNetworking-prefix.pch:2:
While building module 'Foundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/UIKit.framework/Headers\UIKit.h:8:
While building module 'CoreFoundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/Foundation.framework/Headers\Foundation.h:6:
While building module 'Dispatch' imported from C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
In file included from <module-includes>:1:
C:\iOS\builder\SDK\usr\include\dispatch/dispatch.h(64,10): fatal error: could not build module 'os_workgroup'
#include <os/workgroup.h>
~~~~~~~~^
While building module 'UIKit' imported from C:/Users/kolon/Documents/GameGRPL_iOS/GameiOS/Build/Pods//Target Support Files/AFNetworking/AFNetworking-prefix.pch:2:
While building module 'Foundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/UIKit.framework/Headers\UIKit.h:8:
While building module 'CoreFoundation' imported from C:\iOS\builder\SDK/System/Library/Frameworks/Foundation.framework/Headers\Foundation.h:6:
In file included from <module-includes>:1:
In file included from C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers\CoreFoundation.h:78:
In file included from C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:18:
C:\iOS\builder\SDK/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h(20,10): fatal error: could not build module 'Dispatch'
#include <dispatch/dispatch.h>
~~~~~~~~^

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

I suspect a problem with the iOS SDK. It looks like it's bogus. What makes me say that is that libxml2 is defined in two places: SDK/usr/include/libxml2/libxml and SDK/usr/include/libxml

C:\iOS\builder\SDK\usr\include\libxml2\libxml/module.modulemap(1,8): error: redefinition of module 'libxml2'
module libxml2 [system] {
^
C:\iOS\builder\SDK\usr\include\libxml\module.modulemap(1,8): note: previously defined here
module libxml2 [system] {
^

Could you please send me the .zip file with which you migrated your iOS SDK to my email address (pm at this domain) ? I'd like to have a closer look at it. Thanks in advance.

append delete #2. Pierre-Marie Baty

I confirm a problem with the iOS 17 SDK: the folders /usr/include/libxml and /usr/include/libxml2/libxml are identical, at the exception of the Clang module description files (the second one actually points at the first one). The first time it's run with this SDK, the compiler confidently starts building its modules and push them into its module cache, but at some point it stops because it realizes that an identical module has already been built.

The problem doesn't happen with Xcode because Apple ships Xcode and the macOS/iOS SDKs with pre-built modules. Possibly they built them before someone decided to add a second copy of libxml in the SDK/usr/include/libxml2 directory. A typical QA problem.

A workaround is to remove the SDK/usr/include/libxml2/libxml/module.modulemap file by hand. Once this is done, the problem disappears.

I take a note to do that automatically in the SDK deployment script of the upcoming release of the builder.

:: @Pierre-Marie Baty added on 14 Sep ’23 · 16:35

*edit* A cleaner solution is, in this SDK, to overwrite the file SDK\usr\include\libxml2\libxml\module.modulemap with the SDK\usr\include\libxml2\module.modulemap one. This way no file is deleted and the compiler knows that libxml, libxml2 and libxml2\libxml are in fact the same module.

append delete #3. Rushan

Thanks a lot that solved it however now I am getting this error:

https://pmbaty.com/paste/?79933595c129ac79#8DkuPAa15FNFqKpsTQxGd4b7bJJPBLeTGSuU4VKJHGmQ

At the end, it says:

C:\Users\kolon\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:1:1: error: failed to build module 'Dispatch'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9 (swiftlang-5.9.0.123.204 clang-1500.0.37.1)', while this compiler is 'Swift version 5.8.1 (swift-5.8.1-RELEASE)'). Please select a toolchain which matches the SDK.

I suspect this might be the main issue, but I am not sure how to resolve it.

append delete #4. Pierre-Marie Baty

Argh. Damn Apple again! They ship Swift 5.9 with this SDK, but they don't publish their sources until after a long time. The latest release tag for Swift is swift-5.8.1-RELEASE which is dated 17th march. Everything they published after that date was Swift "development snapshots". I could compile one of these "development snapshots" of Swift 5.9 and package it with the next release of the builder, but I'm concerned about stability issues.

Do you have the possibility to build with an earlier SDK ? Such as iOS 16.x. This would avoid the problem until Apple publishes a "5.9-RELEASE" tag of their Swift compiler on their GitHub.

If not I'll have to provide you with a Swift 5.9 from one of their "development snapshots", but I don't like to do that.

append delete #5. Rushan

I don't think I have that possibility.

append delete #6. Pierre-Marie Baty

For information I’m testing a build of LLVM 16 and Swift 5.9. If I’m happy with it I’ll put it in the next update. Thank you for your patience.

append delete #7. Rushan

Hey Pierre, Hope you are doing well. I managed to build with an earlier SDK (iOS 16.2) like you asked. However now I am getting this error:
https://pmbaty.com/paste/?386608a066a9e00a#2SWMDCEaAxSQTFaEk1Hb8W8E4BLpG4xhxAqWhUinrhP9

append delete #8. Pierre-Marie Baty

Hello

I’m unsure about that one. Either SDK corruption, build cache corruption, or incompatibility between code and SDK. Try doing a full rebuild, cleaning caches, and migrate the SDK again if it’s not enough. Also make sure the version of the iOS SDK you use is equal or above the minimal requirement for your project.

append delete #9. Rushan

Hey Pierre,
My game builds perfectly fine without the ads mediation service I was using (Yodo1). However, now I am getting this error while trying to build with IronSource and I'm not too sure how to solve it.
Thank you for all the help

https://pmbaty.com/paste/?df2dfceb79bef987#92XXuMbWYggvkQgGvZfqkhoNp9ibbhwDPqJpsweB6nbn

append delete #10. Pierre-Marie Baty

The error comes because your game’s c++ code generated by Unity includes both libxml and libxml2, which have the same definitions. This is typically an error with the code, but in case libxml and libxml2 are symlinks of each other on Mac it may work (this is not the case on Windows). Are you still using iOS SDK 16.2 with this build ?

append delete #11. Rushan

Yes, I am still using iOS SDK 16.2.

append delete #12. Pierre-Marie Baty

Try this please.

1. Go to C:\Users\<your name>\iOS Project Builder for Unity\SDK\usr\include\libxml2
2. Delete the "libxml" subdirectory that's in it
3. Replace it with a text file containing just "../libxml" (without the quotes, and without newline at the end). That is, two dots, one slash, libxml. Save it in ANSI format (not Unicode, not UTF-8) and name it "libxml" (beware, some text editors - such as Notepad - add a hidden .txt extension; to avoid that just enclose the filename in quotes in the "save file as" dialog box, i.e. type "libxml" and not libxml)
4. Empty/clean your compiler cache in the builder UI and do a full rebuild

Did it help ?

append delete #13. mobiledeveloper2

The original poster didn't respond but I was having the same problem and that fixed it. Thank you.

append delete #14. Pierre-Marie Baty

Thank you for the confirmation. It's weird because the unzip utility bundled with the toolchain (and which is invoked by its absolute path) should create that pseudo-symlink. The fact that it wasn't the case leads me to think that perhaps another unzip.exe executable was called for extracting the SDK, or that the SDK was extracted manually in place. I don't recommend doing this.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty