moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

Getting Error while fetching Strings in iOS, KMM Project

Open AliAzaz opened this issue 3 years ago • 1 comments

I am working on KMM project in which I used Moko-Resource library (VR. 0.20.1) for strings manipulation but the strings are not getting in iOS application, even though I followed each and everything in the documentation.

But there is one twist, iOS is fetching strings if I'm getting it through actual/expect implementation and not working if I am calling it directly through MR.

I also followed issue #181 but it's crashing my app.

My implementation:

 kotlin{
   //For moko resources
    ios {
        binaries.framework {
            isStatic = false
            export(Moko.mokoResourceCommon)
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                api(Moko.mokoResourceCommon)
            }
        }
    }
}


//For moko resources
multiplatformResources {
    multiplatformResourcesPackage = PackageName
    disableStaticFrameworkWarning = true
    multiplatformResourcesVisibility = dev.icerock.gradle.MRVisibility.Internal
}

Working if I'm calling in this way:

actual class StringsLocalization {
    actual fun getTitleName(): ResourceStringDesc = StringDesc.Resource(MR.strings.title_name)
}

>> XCode
var localization = StringsLocalization().getTitleName().localized()

Not getting 'desc().localized()' if I'm calling directly, even it is showing resourceId but i couldn't get any solution to retrieve string from this resourceID.

>> XCode
var localization = MR.strings().title_name.resourceId

AliAzaz avatar Jun 19 '22 12:06 AliAzaz

sorry, i not understand problem. can you give more detailed description or samples?

Alex009 avatar Jun 23 '22 08:06 Alex009