Hi all, getting this error when building in xcode ...
# moko
f
Hi all, getting this error when building in xcode (and the ios target when using android studio) Cannot locate tasks that match 'sharedcopyFrameworkResourcesToApp' as task 'copyFrameworkResourcesToApp' not found in project ':shared'. The app works fine in android and runs happily in the android simulator. Some things : custom build phase looks like this : "$SRCROOT/../gradlew" -p "$SRCROOT/../" sharedcopyFrameworkResourcesToApp \ -Pmoko.resources.PLATFORM_NAME="$PLATFORM_NAME" \ -Pmoko.resources.CONFIGURATION="$CONFIGURATION" \ -Pmoko.resources.BUILT_PRODUCTS_DIR="$BUILT_PRODUCTS_DIR" \ -Pmoko.resources.CONTENTS_FOLDER_PATH="$CONTENTS_FOLDER_PATH" \ -Pkotlin.native.cocoapods.platform="$PLATFORM_NAME" \ -Pkotlin.native.cocoapods.configuration="$CONFIGURATION" \ -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \ -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \ -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS" versions! #Versions kotlin.version=1.9.21 agp.version=8.2.2 compose.version=1.5.11 build gradle targets looks like this : _listOf_( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { iosTarget -> iosTarget.binaries.framework { baseName = "shared" isStatic = true export("dev.icerock.mokoresources0.24.0-beta-1") export("dev.icerock.mokographics0.9.0") binaryOption("bundleId", "com.####.####.shared") } } any ideas why this wont compile in xcode?
k
See in log, how copy task should name in your project. Or send build/sync log for us
f
here's the build log from xcode. Is that what you're looking for? ๐Ÿ™‚
k
Hm... I don't see in logs moko-resources warnings, you disabled they?
f
Not intentionally ๐Ÿ˜…
I don't think so
Like I said, when I run in Android studio on Android target it runs fine
k
please remove this from gradle.properties:
Copy code
moko.resources.disableStaticFrameworkWarning=false
and send new logs, that logs contains copyFramework task name for your build
f
Yeah, it mentions about being a static framework
I've tried building with isstatic as true and false
k
logs contains copyFramework task name for your build
That main reason)
f
Build iosApp_2024-04-22T19-05-34.txt
here is a build from yesterday without that flag
k
that log too doesn't have us messages with task name, can you turn off flag, and find message contains: "If you use a static framework, Xcode should have Build Phase with" better do this in studio, not xcode
f
see line 752 of that log file
Configure project :shared
linkDebugFrameworkIosX64 is found. If you use a static framework, Xcode should have Build Phase with copyFrameworkResourcesToApp gradle task call. Please read readme on https://github.com/icerockdev/moko-resources - To hide this message, add 'moko.resources.disableStaticFrameworkWarning=true' to the Gradle properties.
k
ow, sorry.
f
np ๐Ÿ™‚
k
you dont use cocoapods, its right? Your example looks like: sample kotlin-2-sample and his contain in copy task only this:
Copy code
"$SRCROOT/../gradlew" -p "$SRCROOT/../" :shared:copyFrameworkResourcesToApp \
    -Pmoko.resources.PLATFORM_NAME="$PLATFORM_NAME" \
    -Pmoko.resources.CONFIGURATION="$CONFIGURATION" \
    -Pmoko.resources.ARCHS="$ARCHS" \
    -Pmoko.resources.BUILT_PRODUCTS_DIR="$BUILT_PRODUCTS_DIR" \
    -Pmoko.resources.CONTENTS_FOLDER_PATH="$CONTENTS_FOLDER_PATH"
Can u find difference between your project and sample?
f
you're right, i don't think I use cocoapods. (I'm primarily an android developer and this is my first multiplatform project ๐Ÿ™‚ ) I'll take a look ๐Ÿ™‚
๐Ÿ™Œ 1
i'm sorry, i'm struggling to find that sample, could you please link it?
k
looks in develop branch, that new sample for 0.24.0
f
ah ok thanks ๐Ÿ™‚
found it ^_^
i'm comparing them and just simply dont see where copyFrameworkResourcesToApp is
it's not mentioned in either project outside that build phase script
k
can you send your project, i'm try check him on this week?
f
I can't cos NDAs >.<
k
can you send tasks in moko-resources in gradle of project?
150 Views