https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

EnricCamarero

06/12/2019, 8:32 AM
Hi guys! I’m looking for how to make a mpp project work with the following structure: - MPP Kotlin Module [domain] - iOS App [iosApp] So far my only option to get it to work is manually move the generated framework to my iOS xCode Project. Nonetheless I get this “image not found” runtime error on a daily basis. Is there any way to bind the build process of the iOS App to build and bind the Kotlin framework? I’ve been all over Google looking for an answer with no success so far…
r

ribesg

06/12/2019, 8:36 AM
Well you can just run gradle in the XCode build steps
e

EnricCamarero

06/12/2019, 8:38 AM
yes this is actually what I do, but when it comes to running the app I get the “image not found” error. Any chance you could check this script
Copy code
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

case "$PLATFORM_NAME" in
iphoneos)
TARGET=ios_arm64
TASK=linkMainDebugFrameworkIos
;;
iphonesimulator)
TARGET=ios_x64
TASK=linkMainDebugFrameworkIos
;;
*)
echo "Unknown platform: $PLATFORM_NAME"
exit 1
;;
esac

pwd
echo "$TARGET"
echo "$PLATFORM_NAME"
echo "$TASK"

mkdir -p "$SRCROOT/build/konan/bin/"
rm -rf "$SRCROOT/build/konan/bin/xcode"
cp -r "$SRCROOT/../domain/build/bin/ios/mainDebugFramework" "$SRCROOT/build/konan/bin/xcode"

cd ..
"$SRCROOT/../gradlew" -p "$SRCROOT/../" "$TASK"
r

ribesg

06/12/2019, 8:40 AM
I’m just using Gradle, no bash script needed
6 Views