iOS Build Environment Help Center

Missing header files

append delete FakeMelon

Windows version: 11
Builder version: 3.62
iOS SDK version: 17.4
Link to build log: https://pastebin.com/xJP2NN8k
Frameworks: UserNotifications.framework
Capabilities: app.entitlements
3rd party SDKs: Firebase, Admob, Facebook, Singular

Hi, I'm getting some error about missing header files and when looking for a solution I found this answer to a similar question that suggests that cocoapods doesn't create the required headers folder for BoringSSL-GRPC and indeed that folder is missing in my project after pod install. I've been trying to make it work but to no success.
Here is the answer I was talking about:
https://stackoverflow.com/a/63112942

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

From your build log, I guess that those missing header files might be created by the UNIX shell script for which you're getting a warning. Here:

%
cd "$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME" || exit 1
if [ ! -d Versions ]; then
  # Not a versioned framework, so no need to do anything
  exit 0
fi
 
public_path="${PUBLIC_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}"
if [ ! -f "$public_path" ]; then
  ln -fs "${PUBLIC_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}" "$public_path"
fi
 
private_path="${PRIVATE_HEADERS_FOLDER_PATH#$CONTENTS_FOLDER_PATH/}"
if [ ! -f "$private_path" ]; then
  ln -fs "${PRIVATE_HEADERS_FOLDER_PATH#$WRAPPER_NAME/}" "$private_path"
fi
%

Basically the BoringSSL-GRPC pod expects to run on a POSIX-compatible machine (which Windows is not) and creates two forced symbolic links. There are a lot of shell variables involved here:

PRIVATE_HEADERS_FOLDER_PATH
PUBLIC_HEADERS_FOLDER_PATH
CONTENTS_FOLDER_PATH
WRAPPER_NAME
public_path
private_path

It's not straightforward to work this around, but it's doable.

Those variables should be defined in your Xcode project file. Use the "pbxprojparse.exe" utility supplied with the builder to extract them with their actual value for the right target and configuration. Once you know these variables, you can basically search/replace them in the above script with their contents, and you'll understand exactly where these symbolic links should be created and where they should point at. This will give you the possibility to create them by hand (using the "mklink" command in the Windows console), so that your project can build.

#2. FakeMelon

This post was deleted by its owner

append delete #3. FakeMelon

Thank you for the answer but I'm very confused on how to get it working. I'm not sure how to work with pbxprojparse to extract which parameters, I'm not even sure what a symbolic link is.

append delete #4. Pierre-Marie Baty

It'll be difficult for you to workaround this issue without being fluent enough with UNIX semantics because what is needed is to translate a UNIX shell script into a Windows equivalent.

In your situation, I advise you to prefer precompiled frameworks. Download the corresponding iOS framework releases for Firebase, Admob, Facebook and Singular and proceed to adding them to your build using the method described in the documentation. Do you need help for that ?

append delete #5. FakeMelon

You're talking about stage 8 in the tutorial right?
I guess I do need some help with that.
First, do i need to tell cocoapods that I already have some of the pods predownloaded so it doesn't have to download them again?
Second, I guess according to the tutorial that I will need to try and build multiple times per framework to figure out which flags are needed like you showed in the tutorial with ad mob. I would assume many people did that before me, so maybe all those needed flags are already written somewhere maybe in the tutorial or here in the forum?
Lastly, I saw this post: https://www.pmbaty.com/iosbuildenv/help/thread.php?path=Problem%20solving/&file=firebase-google-mobile-ads-admob-version-matching-table
I think it's a bit outdated but I guess I could just take the last versions of both? I'm a bit confused because it's not even matching the version numbers for the sdk I'm using on windows.

append delete #6. Pierre-Marie Baty

You can proceed either way. Either you remove just one pod from the Podfile, and you supply it by hand to the linker, or you disable the Podfile completely, and you must supply all of the pods. I recommend the latter case, as it's not more difficult to feed several precompiled frameworks to the builder than to have just one.

Either way I *DO NOT* advise that you attempt things without understanding what they do. You say that you hope to just copy/paste a list of compiler and linker flags. It won't work that way. There are countless differences between SDK versions, framework versions, Unity engine versions, and user projects themselves. Not counting that every now and then the suppliers of all those popular SDKs completely change their API or the layout of their SDKs.

The thread you gave the link to is quite outdated ; don't rely on it. Take the time to read through the documentation (the builder's, and your SDK suppliers'), proceed step by step, and everything will go fine. Post here if you need help, after you've made reasonable effort at it.

You can save yourself a lot of time by reading the Firebase, Admob, Facebook, and Singular documentation -- they necessarily tell somewhere how to build iOS projects using their SDK without CocoaPods (look for paragraphs that talk about "manual" setup in their docs). With some luck, you won't even need to go through the missing parts identification step : if you follow these suppliers' instructions and add the right frameworks for your project to the builder upstart, there are great chances that your project will compile successfully at the first try.

If it doesn't, and there are still "missing symbols", the global idea that you should follow is that even if you're trying to build your project without all the necessary stuff, the fact that it fails is a *good thing*, because the error message will tell you what's missing. Don't close the window, read the errors and understand them. Proceed methodically, identifying the missing "symbols" the linker tells you are missing (that's actually "functions" and "variables" that have been compiled to machine code) by looking up their name in a search engine, download the precompiled framework for iOS in which they are from their supplier's website, and try again. You don't need to understand what these functions and variables do, not at all -- all you need is to find out which framework they come from. Don't feel discouraged by the large number of missing "symbols" : each time you'll add a framework in which one of them is defined, you'll make dozens of them disappear from the error list at once. At some point you'll have no more errors and your project will build. When you reach this point, *save* the builder's configuration to preserve the precious compiler and linker flags that enabled you to build your project.

Once you'll get used to this method, I promise you'll never be tempted to use CocoaPods again. And this is not something specific to Windows : macOS users can perfectly do that too in Xcode - the build logs are just somewhat less readable.

append delete #7. FakeMelon

I'm getting pretty close to figuring this out I think, I was getting errors with facebook so I decided to try a build without facebook and it worked! I got an .ipa but haven't tested it yet. I will test it, but simultaneously I would like to share with you the errors I get when facebook is in the build because I tried for a couple hours and couldn't figure it out.
This is the log: https://pastebin.com/rKZR9J1n

I will also add the flags that are related only to facebook:
compiler flags:
-F"C:/iOS/FBSDK/FBSDKCoreKit.xcframework/ios-arm64"
-F"C:/iOS/FBSDK/FBSDKCoreKit_Basics.xcframework/ios-arm64"
-F"C:/iOS/FBSDK/FBSDKGamingServicesKit.xcframework/ios-arm64"
-F"C:/iOS/FBSDK/FBSDKLoginKit.xcframework/ios-arm64"
-F"C:/iOS/FBSDK/FBSDKShareKit.xcframework/ios-arm64"
-F"C:/iOS/FBSDK/FBAEMKit.xcframework/ios-arm64"

linker flags:
-ObjC
-F"C:/iOS/FBSDK"
-framework FBSDKCoreKit
-framework FBSDKCoreKit_Basics
-framework FBSDKGamingServicesKit
-framework FBSDKLoginKit
-framework FBSDKShareKit
-framework FBAEMKit

Thank you very much!

append delete #8. FakeMelon

Hi, just making sure you didn't miss my message

append delete #9. Pierre-Marie Baty

Hello

Sorry for the delay. By reading your build log I see that Facebook not only adds frameworks, but also injects Swift source files in your project, which has the effect of making it a *mixed-language* Swift/Objective-C project. The bad news is that at the moment, only Xcode is able to build mixed-language projects ; I haven't had enough time to reverse-engineer how they do to reimplement that properly in the builder.

The workaround to this at the moment is to change your Facebook SDK version to the latest Facebook SDK that did not have Swift files in it. Until I find the time to finish implementing mixed-language support. Hopefully you won't lose a lot of features by using an older Facebook SDK.

append delete #10. FakeMelon

Hi, for now I decided to remove the facebook sdk because it wasn't that critical to us for now so we prefer to deal with it later.
After that, I managed to build the app and upload it to testflight and it worked successfully! Very happy about that.
Thank you so much for your continued support throughout the challenges I faced!

append delete #11. Pierre-Marie Baty

Thank you for your appreciation.

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