-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compile after trying to update to 0.24.0: Unable to find method GenerateMultiplatformResourcesTask.onlyIf #732
Comments
Hi. What gradle version used? |
Hello, I'm running gradle 7.5. Thanks for the pointer, that seems to be the issue. The error went away. There is a new error now, but that seems to be related to a resource, where the previous moko version was less restrictive maybe.
I'll see if I can figure that out. |
Most likely it has to do with this change: StringExt.kt String.convertXmlStringToAndroidLocalization I have various strings that are empty, e.g. like: If these are getting into that method, the call to this[0] fails. |
Another example with plurals <plurals name="missing_chapters">
<item quantity="one"/>
<item quantity="other">Жоқ %1$s тараулары</item>
</plurals> |
will be released in 0.24.1 |
* fix(deps): "String index out of range" compile error REF: icerockdev/moko-resources#732 * refactor(i18n): Simplify gradle * refactor: Migrate i18n files to moko-resources Also split plurals to their own files * fix: Only use firebase on releases * revert: Revert "fix: Only use firebase on releases" This reverts commit e4f40b4. * ci: Just build standard release * refactor: Fully migrate to Moko Resources for i18n
First of all: Thanks for all the efforts that went into the 0.24.0 Update
I tried to update my project to 0.24.0 but during compilation the following error is thrown:
java.lang.NoSuchMethodError: 'void dev.icerock.gradle.tasks.GenerateMultiplatformResourcesTask.onlyIf(java.lang.String, org.gradle.api.specs.Spec)' at dev.icerock.gradle.extra.MokoResourcesGenTaskKt$registerGenerateTask$taskProvider$1.invoke(mokoResourcesGenTask.kt:110) at dev.icerock.gradle.extra.MokoResourcesGenTaskKt$registerGenerateTask$taskProvider$1.invoke(mokoResourcesGenTask.kt:78) at dev.icerock.gradle.extra.MokoResourcesGenTaskKt.registerGenerateTask$lambda$0(mokoResourcesGenTask.kt:81) at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44) at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
What I did:
buildscript { dependencies { [...] classpath: "dev.icerock.moko:resources-generator:0.24.0" } }
multiplatformResources { resourcesPackage.set("com.example.projectname") iosBaseLocalizationRegion.set("en") }
Somehow there seems to be an issue with caching, because the IDE says that the resourcesPackage property of multiplatformResources in the build.gradle.kts file is an unresolved reference. If I go to the declaration of the multiplatformResources it opens the old 0.23.0.jar
I cleared various cache folders, including the ~/.gradle/ folder, which contains the ~/.gradle/caches/jars-9/..../resources-generator-0.24.0.jar and 0.23.0.jar, but to no avail.
Any ideas, what might be wrong?
If I change back the resources-generator class path dependency to 0.23.0 it compiles, but of course all resources are empty, because they are located in the new directory moko-resources, where the old generator does not search for them.
The text was updated successfully, but these errors were encountered: