Darwin Build Environment Help Center

BillingServices/BillingServices-Swift.h file not found

append delete JF

Windows: 11
Builder: 3.72
IOS SDK: 18.4

This may not be a problem with IOS Project Builder, but this has happened since I upgraded the SDK and IOS Project Builder to the newest version, so I am wondering if the migration script didn't grab some Billling related Swift files in the IOS SDK.

I am repro'ing this on a fresh empty Unity project (with only the Voxelbusters library billing installed).

Should there be a billing .framework directory in SDK-IOS\System\Library somewhere?

This is using Essential Kit (Voxelbusters) for Billling, which I have been doing for a while now, but just encountered this problem after upgrading. Is "BillingServices/BillingServices-Swift.h" something that should come from the IOS SDK? Or is this just the third party library having a bug.

In file included from VoxelBusters\EssentialKit\BillingServices\NPBillingServicesBinding.mm:11:
VoxelBusters\EssentialKit\BillingServices\NPBillingServicesDataTypes.h(12,9): fatal error: 'BillingServices/BillingServices-Swift.h' file not found
12 | #import <BillingServices/BillingServices-Swift.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ [arm64] Recompiling VoxelBusters\EssentialKit\NativeUI\UIAlertController+DatePicker.m (flags changed)...
1 error generated.
detected compiler error, aborting multithreaded build.
In file included from VoxelBusters\EssentialKit\BillingServices\NPBillingServicesDataTypes.mm:9:
VoxelBusters\EssentialKit\BillingServices\NPBillingServicesDataTypes.h(12,9): fatal error: 'BillingServices/BillingServices-Swift.h' file not found
12 | #import <BillingServices/BillingServices-Swift.h>

The contents of the NPBillingServicesDataTypes.h file starts with:

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import "NPKit.h"
#import <BillingServices/BillingServices-Swift.h>
...

The content of NPBillingServicesBinding.mm starts with:

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import "NPBillingServicesDataTypes.h"
#import "NPDefines.h"
#import "BillingServices/BillingServices-swift.h"
...

I'm not really sure where that -swift.h file comes from though.

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello JF

It may be a regression in the latest version of the builder. That was not completely unexpected and I apologize. I have fixed a handful of bugs since I rewrote the POSIX compatibility layer a few versions ago. But I prefer fixing problems as soon as I discover them, even at the risk of breaking something else, instead of letting flawed code behind me that may have repercussions who knows where else, the important point here being not what regressions it might cause but how fast I can fix them and restore feature parity, and I think I do well at that.

May I ask you to upgrade to v3.73 which I just uploaded minutes ago, and tell me if it fixes the problem ? I have good hopes it will. Keep me informed please.

append delete #2. JF

I downloaded 3.73 and actually get a different error about $LIB_ARCH now:

+ Building libGameAssembly.a for iphoneos (configuration: Release)
+ Using Unity il2cpp compiler: 6000.0.48f1
+ Calling the Unity il2cpp compiler to build the game assembly library...
PLEASE NOTE: this step MAY take time, and Unity doesn't always display
its progress. You can tell it's working by checking your CPU activity.
It should display 28 instances of clang.exe associated with il2cpp.exe.
======================= il2cpp output BEGIN =======================
Starting: C:\Users\REDACTED\TestProject2\Build\Il2CppOutputProject\IL2CPP\build\deploy_win64\bee_backend\win-x64\bee_backend.exe --verbose --threads=28 --dont-print-to-structured-log --ipc --dagfile="Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/bee.dag" --continue-on-failure --profile="Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/backend1.traceevents" FinalProgram
WorkingDir: C:/Users/REDACTED/TestProject2/Build
[ ] Require frontend run. Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/bee.dag couldn't be loaded
ExitCode: 4 Duration: 0s17ms
Failed:
Error: Internal build system error. BuildProgram exited with code 1.
System.ArgumentException: Unknown architecture: $LIB_ARCH
at Unity.IL2CPP.Bee.BuildLogic.BeeArchitectures.For(String il2cppArchitecture)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Compile.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments, Dictionary`2 envVars)

Unity.IL2CPP.Compile.CompileFailedException: Failed:
Error: Internal build system error. BuildProgram exited with code 1.
System.ArgumentException: Unknown architecture: $LIB_ARCH
at Unity.IL2CPP.Bee.BuildLogic.BeeArchitectures.For(String il2cppArchitecture)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Compile.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments, Dictionary`2 envVars)

at Unity.IL2CPP.Compile.CompilationDriver.Run(TinyProfiler2 tinyProfiler, Il2CppCommandLineArguments il2CppCommandLineArguments, String il2CppInvocationString, String directoryHoldingIl2Cpp, String distributionDirectory)
at Program.<Main>$(String[] args)

Error: il2cpp.Compilation.BuilderFailedException: Build failed :
Starting: C:\Users\REDACTED\TestProject2\Build\Il2CppOutputProject\IL2CPP\build\deploy_win64\bee_backend\win-x64\bee_backend.exe --verbose --threads=28 --dont-print-to-structured-log --ipc --dagfile="Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/bee.dag" --continue-on-failure --profile="Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/backend1.traceevents" FinalProgram
WorkingDir: C:/Users/REDACTED/TestProject2/Build
[ ] Require frontend run. Il2CppTempDirArtifacts/$CONFIGURATION/artifacts/$LIB_ARCH/buildstate/bee.dag couldn't be loaded

append delete #3. Pierre-Marie Baty

Ah, it looks like new environment variables need to be passed to il2cpp with this version of Unity.

Open the build.cmd file that is located in the project builder's install path. Go to line 2420, and copy/paste this exactly :

% build.cmd line 2420
		rem // replace $CONFIGURATION with the value of our IL2CPP_CONFIG environment variable
		echo s^|\$CONFIGURATION^|!IL2CPP_CONFIG!^|g

		rem // replace $LIB_ARCH with the value of our IL2CPP_ARCH environment variable
		echo s^|\$LIB_ARCH^|!IL2CPP_ARCH!^|g

%

Save and close the file. Rebuild and let me know if it fixes the problem. If so I'll push an emergency update.

append delete #4. JF

The fix worked but I am now back to the original error at the top of the post; fatal error: 'BillingServices/BillingServices-Swift.h' file not found

I updated to 3.73.1 and same issue.

append delete #5. Pierre-Marie Baty

When you do a file search in your Xcode project source tree, does such a file "BillingServices-Swift.h" exist somewhere ?

Either it exists, in which case it's just a matter of passing an extra include path to the compiler, or it doesn't, which would mean the builder's supposed to generate it before trying to compile this target. That would mean this particular version of the library or framework "BillingServices" uses mixed sources (Swift + Objective-C in the same target) and that's something the builder still doesn't handle well unfortunately.

To produce a BillingServices-Swift.h file (an Objective-C header) describing the Swift interfaces of this mixed-source target requires the Swift interfaces to be built and a module created, but those sources depend on the Objective-C part to be built, which itself requires that BillingServices-Swift.h file to exist to compile. Chicken and egg problem. I don't understand well how Xcode does that.

append delete #6. JF

There isn't a BillingServices-Swift.h anywhere in the xcode tree -- and the xcode project does build successfully in xcode itself if I copy the tree over to my iMac.

This is interesting, since it's a new phenomenon; I did not have this issue until very recently.

append delete #7. Pierre-Marie Baty

There must be a slight difference in the version numbers of the pods your project uses, and this is where it's breaking.

As a workaround I advise you to add these frameworks in precompiled form (follow the docs on how to do that, and don't forget to add the -ObjC linker flag).

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