Richie Rodríguez
03/04/2024, 9:50 AMRobert Munro
03/04/2024, 12:18 PMshared.xcframework
have your functions in the header file?Richie Rodríguez
03/04/2024, 2:27 PMcore/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)/core.framework/Headers
, I get a core.h
headers file with the definitions (not shared, but core project). For example, Xcode complains about CoreBuild
and I can see [...] @class [...], CoreCoreBuild, [...]
.Robert Munro
03/04/2024, 5:02 PMRobert Munro
03/04/2024, 5:07 PMshared/build/XCFrameworks/release/shared.xcframework
Richie Rodríguez
03/04/2024, 10:25 PMcore/build/xcode-frameworks/Debug/iphonesimulator17.0/core.framework
. I can update the build.gradle.kts
script to export an XCFramework. I will let you know. Thank you very much for your suggestions.Robert Munro
03/08/2024, 11:21 AMkmmbridge
to do the build. which works quite well for me.Richie Rodríguez
03/14/2024, 11:47 AMAppData -> Cannot find type 'CoreBuild' in scope
If I check the headers file core.h
, I can find the missing types:
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("CoreBuild")))
@interface CoreCoreBuild : CoreBase
I run
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
cd "$SRCROOT/../.."
./gradlew :core:embedAndSignAppleFrameworkForXcode
To build the core library
Then, in Build Settings -> Search Paths I have added the
$(SRCROOT)/../../core/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
Path to Framework Search Paths and,
$(SRCROOT)/../../core/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)/core.framework/Headers
Path to Header Search Path.
If I delete de build folder, the artifacts are reproduced again after running the build script from Xcode. Everything seems correct. Obviously I’m missing something. Do I have to include a dependency to my core library in the iOS project Podfile?
https://kotlinlang.slack.com/docs/T09229ZC6/F06PWMHDRA5Robert Munro
03/14/2024, 12:54 PMRobert Munro
03/14/2024, 1:07 PMRichie Rodríguez
03/15/2024, 10:17 AM-framework core
and it worked too. But... I'm afraid it's not finished yet. As the framework may be created under different paths:
$(SRCROOT)/../../core/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
I can't just add the framework to "General -> Frameworks, Libraries, and Embedded Content". And, afaik, if I just add -framework core,
I have to manually copy de framework to my app bundle before distributing it. Am I correct? How can I add the framework to "General -> Frameworks, Libraries, and Embedded Content" using environment variables?Robert Munro
03/15/2024, 1:56 PMRobert Munro
03/15/2024, 1:58 PMRichie Rodríguez
03/17/2024, 11:17 AMcore
in our project) and the iOS application are in the same repo, and I use a relative path to indicate it in the Search Path in Xcode. I'm afraid my days as a C developer are further behind than I'd like to admit, but I understood that by linking it, I was indicating that the said library (framework in this case) should be available on the target device. My knowledge in this area of Xcode is not sufficient to understand exactly what the option -framework core
does (that's the name of the 'shared' module in this project). That's why I thought it would be necessary to copy it to the iOS application bundle.Robert Munro
03/17/2024, 11:35 AMRobert Munro
03/17/2024, 11:37 AM