Closed Egi10 closed 4 months ago
hi. can you create small reproducer project?
I've tried replicating the issue by creating a sample project, but the same error doesn't occur.
Previously, I was using version 0.23.0 and everything was working smoothly. When the latest version came out and I wanted to upgrade Kotlin, I tried to update. However, I encountered the error.
I haven't encountered this issue before, but my project is not working properly. For now, I have downgraded to version 0.23.0 and implemented the solution from https://github.com/icerockdev/moko-resources/issues.
After further investigation, I discovered that the root cause of the issue lies in the module naming convention within my project:
-shared --common ---resources --core
This naming structure triggers an error during the execution of compileIosMainKotlinMetadata
. However, if I change the module name to anything other than resources
, the error disappears.
Example project: https://github.com/Egi10/resources
cc @Alex009
I'm now encountering an issue when running the app on iOS with the error: kotlin.IllegalArgumentException: bundle with identifier ***.main not found
. I've also added a new configuration, but the problem persists :
"$SRCROOT/../gradlew" -p "$SRCROOT/../" :yourframeworkproject:copy`YourFrameworkName`FrameworkResourcesToApp \
-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.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
This naming structure triggers an error during the execution of compileIosMainKotlinMetadata. However, if I change the module name to anything other than resources, the error disappears.
i think it's kotlin bug with module names clash. https://youtrack.jetbrains.com/issue/KT-57914
I've also added a new configuration, but the problem persists
please show full code of your xcode resources build phase and also logs from build process
I added the following script to the Build Phase:
"$SRCROOT/../gradlew" -p "$SRCROOT/../" :shared:core:copyPodFrameworkResourcesToApp \
-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.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
However, I encountered this error at runtime when trying to access the resources.
I got the copyPodFrameworkResourcesToApp from a warning.
linkPodDebugFrameworkIosArm64 is found.
If you use a static framework, Xcode should have Build Phase with copyPodFrameworkResourcesToApp 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.
Issue resolved, it turned out there was a problem with my custom plugin.
I encountered an error in my multimodule project after updating to Moko Resources version 0.24.1. The error occurs when using strings in the actual class on the iOS platform (iosMain).
Project Structure: -shared --common ---resource --core
Example Code:
Common (expect):
iOS (actual):
Android (actual):
Note: This error was encountered during a rebuild in Android Studio, but the project still runs when executed on Android and iOS.