No such module error when trying to create framework with ARCore as dependency

45 Views Asked by At

I'm looking to create a framework A which has ARCore from Google as a dependency, and distribute it ideally as an independant XCFramework, but right now, any way I can distribute it is good enough (for exemple via Cocoapods). I only use the GeoSpatial module of ARCore it this developement.

When I work on the framework on its own, I have no issues adding ARCore in its podfile, adding "import ARCore" and making all of its feature work as expected.

But when I go and try to integrate my framework to an app, I get the same error over and over "No such module: ARCore". ARCore is recognized in the sample app though, but not in my framework anymore.

enter image description here

The podspec in my framework is

Framework podspec

The podfile in my sample app is

Sample App podfile

What I tried to do to fix it :

  • Adding import ARCore in the sample app

  • Adding/Removing the spec.static_framework = true in my podspec. (I believe keeping it is the right move)

  • I used use_modular_headers! in my podfile instead of use_frameworks !, (and also tried to remove it but I believe keeping it is the right way)

  • I also tried to archive and build my framework as an XCFramework, and use vendored_frameworks in my podspec, but not only did I see the same "no such module" error but I could see that my archive did not embed the ARCore frameworks. I know nested xcframeworks are not recommanded but it feels like this is linked to the problem.

The only way I can make the sample app compile is to import ARCore as modules, like below.

enter image description here

But then the framework on its own does not compile anymore with error "could not build objective-c module arcorebase" and "inferred submodule require a module with an umbrella" in my modulemap.

The fact that ARCore presents itself as xcfameworks with submodule seems to be the reason it does not work as expected but I can't seem to figure out why.

Any help would be much appreciated!

0

There are 0 best solutions below