Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Framework "Module 'RealityKit' not found"

I want to create my own Framework that will use RealityKit functionalities. Framework project compiles properly without errors, but when I import it to my new project and try to compile I get an error

"Module 'RealityKit' not found"

Can I add RealityKit somehow to my Framework so it will be included or should I change path somewhere ?

When I import RealityKit directly to new project it works, but when I try importing my Framework I get this error.

I get the error at this point in MyFramework-Swift.h

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import ARKit;
@import CoreGraphics;
@import Foundation;
@import QuartzCore;
@import RealityKit; // Module 'RealityKit' not found
@import UIKit;
#endif
like image 887
RealUglyDuck Avatar asked Aug 31 '25 22:08

RealUglyDuck


1 Answers

After going through all the files that use RealityKit I found what was causing the error. In one of the files I was making extension to ARView to add some custom functionalities and even if I leave it blank like that:

import RealityKit
extension ARView {}

It still gives me "module RealityKit not found" so to walk this around I just created class that makes the same operations as my previous extension and it worked. When I import framework to the project now, it builds without errors.

like image 66
RealUglyDuck Avatar answered Sep 03 '25 21:09

RealUglyDuck