iOS Build Environment Help Center

Firebase errors when building.

append delete Iosif

Windows 10.
Unity 2020.3.21f1
iOS Builder 3.43
iOS SDK 15.2

---

The first error I got was "googlemobileads/googlemobileads.h file not found unity". It disappeared when adding the google mobile ads extra frameworks.

But now the builder stops here and I don't know what to do exactly.

https://postimg.cc/Th6Mg9zp

Thank you.

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Wow, that's some excessively long pathname that Firebase is trying to have here. It's almost certain that it collides with the Windows 260 characters path limit.

The involved program in the toolchain here is the compiler cache (ccache.exe). I have put an option to clear it, but no option to completely disable it.

I can suggest two workarounds.

The first workaround I can give you is to open the master build script build.cmd with a text editor, and replace that line:

% in build.cmd around line 1973
set COMPILER_CMDLINE="!TOOLCHAIN_PATH!\ccache.exe" "!TOOLCHAIN_PATH!\clang.exe" -target !ARCH!-apple-ios!MINIOSVER! --sysroot "!SDK_PATH!" -fmodules-cache-path="!TOOLCHAIN_PATH!\.llvm-modules" -o "!OBJFILE!" -c "!SRCFILE!" @"!OBJFILE!.clangflags"
%

with :

% build.cmd
set COMPILER_CMDLINE="!TOOLCHAIN_PATH!\clang.exe" -target !ARCH!-apple-ios!MINIOSVER! --sysroot "!SDK_PATH!" -fmodules-cache-path="!TOOLCHAIN_PATH!\.llvm-modules" -o "!OBJFILE!" -c "!SRCFILE!" @"!OBJFILE!.clangflags"
%

This change will call the compiler directly for each source file instead of asking the compiler cache whether a compiled object already exists for that file. The immediate drawback will be that the compilation time will be (quite) longer, but the Clang compiler has some well-tuned intermediate layer of code to better handle this infamous path limit on Microsoft systems.

Another workaround would be to disable that Pod in the Podfile and use precompiled libraries or frameworks (possibly for all pods as this would result in faster builds: it's always faster to just link precompiled code than to rebuild it all from source).

Meanwhile I'll try to improve long pathnames support in ccache, but it'll be a hell of a lot of work just to workaround a stupid historical limit in the Microsoft OS. I just wished the Google people that work in Firebase be more reasonable with filenames and reorganize their codebase more cleverly...

:: @Pierre-Marie Baty added on 23 Dec ’21 · 11:10

Also, would you mind sharing with me the project you're trying to build so that I have a real-life test case against which to test my changes ? I guarantee strict confidentiality.

append delete #2. Iosif

Hello again, sorry for the delay, I was on vacation.

This solved my problem but now I get another one that is produced by the admob plugin.

https://postimg.cc/Z94v2NSm

Thank you for your help.

append delete #3. Pierre-Marie Baty

Hello

This rather looks like a mismatch between the AdMob API declarations in your Unity project and the AdMob headers. Plugin version mismatch maybe ?

append delete #4. Iosif

Hi,

Thank you very much for your help, I can now create the project. Without your help it would not have been possible!

Thanks again!

append delete #5. Pierre-Marie Baty

You're welcome. Happy building

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