Ratul Sarna
01/09/2024, 6:56 PMtoUIImage()
could be returning nil
when called from Swift in the iOS project? The assets (images) and generated class show the image correctly in the build directory.Shakhzod Ilkhomov
01/12/2024, 6:48 AMDjuro
01/12/2024, 1:33 PMbuild.gradle.kts
,
I had to add
sourceSets {
androidMain {
dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.ktor.client.android)
implementation(libs.decompose)
}
dependsOn(commonMain.get()) ----> this line
}
dependsOn(commonMain.get())
line for example, why?
Also in iOS, I had change isStatic = false
instead of true
which was there by default. What does this change for me?
I also added
"$SRCROOT/../gradlew" -p "$SRCROOT/../" :yourframeworkproject: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"
My main issue was that isStatic
field was set to false
Also, I had to add following code to KotlinMultiplatformExtension
kotlin {
applyDefaultHierarchyTemplate()
}
Isn't there any simpler way to perform all of this? Am I doing something wrong or is it supposed to be like thisalex009
01/15/2024, 3:33 AMSuresh Maidaragi
01/17/2024, 11:51 AMmoko-resources
to load resources
currently I am seeing actual implementation is not able to generate fully by Android studio, i.e means it generating partially actual and expect files, is it because library?. Same moko resource I used in working projects it can generate actual and expect and works fine. But moko-resource couldn't able to generate actual and expect only in case of libraryDjuro
01/20/2024, 1:39 PMstrings.xml
I have a string resource with name length of specific size ex.
<string name="confirm_new_password_placeholder">Confirm your new password</string
notice that the name confirm_new_password_placeholder
had kinda too many characters (32)
What happens is that Android works fine but iOS is causing issues and can't handle these resources properly. For example, output text value of Text(stringResource(MR.strings.confirm_new_password_placeholder))
on Android it would be Confirm your new password
on iOS it would be _confirm_new_password_placeholder -_ literally like this
Did someone face this issue?
using 0.24.0-alpha-1Huy Tâm
01/22/2024, 8:46 AMSuresh Maidaragi
01/22/2024, 6:40 PMmoko resources
to new kmm project, can someone help to check..
Slack Conversationelectrolobzik
01/23/2024, 7:37 PMACCESS_BACKGROUND_LOCATION
is not included in moko-permissions
?SK
01/23/2024, 9:49 PMKatyrin Roman
01/25/2024, 6:41 AM- shared
-- resources
-- feature-1
-- feature-2
The only working solution that made my project build on both Android and iOS was to register the moko resources plugin for the iOS version, and remove this solution for Android. Also, when building the IOS, it is necessary to replace implementation(project(:resource)) with api(project(:resource))
My shared module:
plugins {
. . .
id("dev.icerock.mobile.multiplatform-resources") <- only for ios
}
kotlin {
androidTarget()
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = ProjectSettings.IOS_DEPLOYMENT_TARGET
version = ProjectSettings.VERSION_NAME
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
isStatic = true
export(project(":resource"))
transitiveExport = true
}
}
sourceSets {
val commonMain by getting {
dependencies {
api(project(:resource)) <- api for ios, implementation for android
}
}
. . .
}
. . .
}
Is there a more automated way to build two versions without making changes to Gradle?
Thanks in advance for any answer or advice on what I'm doing wrong)
Kotlin: 1.9.10
Gradle plugin: 8.1.2
Moko-resources: 0.23.0Shakhzod Ilkhomov
01/25/2024, 12:30 PMmarschwar
01/29/2024, 6:50 PMmoko-resources
generally work together with android build flavors. I do experience an issue in Android Studio with version 0.24.0-alpha2. See https://github.com/icerockdev/moko-resources/discussions/625#discussioncomment-8287130 for details.alex009
01/31/2024, 3:03 PMSuresh Maidaragi
02/08/2024, 11:07 AMnon-flowable
version of currentBackStackEntry
available on precompose as like Compose as shown in screen shot
1st screen using precompose,
2nd screen using native composeSuresh Maidaragi
02/08/2024, 11:26 AMVaibhav Jaiswal
02/11/2024, 12:05 PMshared
|
| -> ui
|-> screens
|-> core (moko resources lie here)
|-> components
.........
Suresh Maidaragi
02/13/2024, 8:31 AMSavedStateHolder
from package moe.tlaster.precompose.stateholder
is same as Native SavedStateHandle
? from package androidx.lifecycle
If so, how can we access
access value as like in native in moko
savedStateHandle.get<String>(Screen.ARGS_KEY) //native code
Djuro
02/19/2024, 1:24 PMmoko-resources
issues when working with compose multiplatform, version 1.6.0-beta01
is not working
:common:linkDebugFrameworkIos FAILED
I had to change to 1.6.0-alpha01
Sean Proctor
02/19/2024, 1:40 PMmoko-resources-<buildType>
kevin.cianfarini
02/22/2024, 7:05 PMShowing Recent Messages
Cannot locate tasks that match ':shared:octopus:copyFrameworkResourcesToApp' as task 'copyFrameworkResourcesToApp' not found in project ':shared:octopus'.
I noticed in the multiple alpha releases this has come up as a bug that’s needed resolution. When I check what tasks are available on our umbrella shared framework, I see the following:
Moko-resources tasks
--------------------
copyResourcesDebugFrameworkIosSimulatorArm64
copyResourcesDebugTestIosSimulatorArm64
copyResourcesReleaseFrameworkIosSimulatorArm64
We are setting the base name of our prefix in our framework.
binaries {
framework {
baseName = "shared"
isStatic = true
Does this sound like a bug with moko-resources, or is there something obvious that we’re doing wrong?Bekzod
02/23/2024, 10:24 AMVaibhav Jaiswal
02/26/2024, 8:08 AMpainterResource()
, my composable recomposes as the instance changed but content is same
Is the painter instance returned from painterResource
not remembered?KimJason
02/27/2024, 7:10 AMmultiplatformResources {
resourcesPackage.set("com.icerockdev.library")
// multiplatformResourcesPackage = "com.icerockdev.library"
}
Marco Pierucci
03/04/2024, 2:57 PM:feature:auth:ui:iosArm64Main: Could not find dev.icerock.moko:moko-resources:0.24.0-alpha-5.
For the config being
plugins {
...
alias(libs.plugins.moko)
}
kotlin {
sourceSets {
commonMain.dependencies {
...
api(libs.moko.resources)
api(libs.moko.resources.compose)
}
}
}
android {
namespace = "app.kraken.field.feature.auth.ui"
}
multiplatformResources {
resourcesPackage = "app.kraken.field.feature.auth.ui.resources"
resourcesClassName = "SharedRes"
resourcesVisibility = MRVisibility.Internal // optional, default Public
iosBaseLocalizationRegion = "en" // optional, default "en"
}
brandonmcansh
03/05/2024, 10:29 PMSuresh Maidaragi
03/07/2024, 4:52 AMSuresh Maidaragi
03/10/2024, 9:44 AMjetpack compose to v1.6.0-rc03
and
multiplatform 2.0.0-Beta4
and tried running iOS building started seeing this issue for Strings, image, font
error: Object 'MR.images' is not abstract and does not implement abstract member 'nsBundle'.
error: Object 'MR.strings' is not abstract and does not implement abstract member 'nsBundle'.
error: Object 'MR.colors' is not abstract and does not implement abstract member 'nsBundle'.
error: Object 'MR.fonts' is not abstract and does not implement abstract member 'nsBundle'.ynsok
03/15/2024, 12:24 PMThomas
03/19/2024, 1:43 AMStringResource.desc().localized()
.
Is there a good way to obtain a string of a particular locale programmatically, without automatic locale resolution? Like perhaps a function that takes a NSLocale
object. Thanks.