Skip to content
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

Expected object 'SharedRes' has no actual declaration in module <composeApp_debug> for JVM #606

Closed
pankaj1920 opened this issue Nov 26, 2023 · 11 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pankaj1920
Copy link

Expected object 'SharedRes' has no actual declaration in module <composeApp_debug> for JVM

@pankaj1920
Copy link
Author

sourceSets {
    getByName("main").java.srcDirs("build/generated/moko/androidMain/src")
}

after adding this it is working but localization is not changing realtime as i change the device language from setting. i have to close app and reopen then it is working

@pankaj1920 pankaj1920 changed the title Getting this error Expected object 'SharedRes' has no actual declaration in module <composeApp_debug> for JVM Nov 26, 2023
@ScottPierce
Copy link

ScottPierce commented Dec 2, 2023

I'm seeing a similar problem with multiplatform. The work around was:

    sourceSets {
        getByName("androidMain") {
            kotlin.srcDir("build/generated/moko/androidMain/src")
        }
    }

@Dardev12
Copy link

Dardev12 commented Dec 8, 2023

Thank for the solution this have solve my problems too :) ✅

I think we can close this ticket ❌

@ScottPierce
Copy link

Thank for the solution this have solve my problems too :) ✅

I think we can close this ticket ❌

I don't think so. This should be fixed in the plugin. The workaround shouldn't be necessary.

@Bradleycorn
Copy link

I'm also seeing this issue. Thanks for the workaround @ScottPierce.
I agree this should have a proper fix

@Alex009 Alex009 added this to the 0.24.0 milestone Jan 14, 2024
@Alex009
Copy link
Member

Alex009 commented Jan 14, 2024

fix in #575

@avently
Copy link

avently commented Mar 25, 2024

Alex009

fix in #575

Don't think it's fixed because I have similar error message on 0.24.0-alpha-5:

Expected object 'MR' has no actual declaration in module <common> for JVM

In my case I have android, common, desktop source sets. On Desktop build I see this error, Android build works fine. desktopMain directory is not created at all in common/build/generated/moko. So workaround with srcSet will not work because of this.

@Alex009
Copy link
Member

Alex009 commented Mar 25, 2024

@avently please preapre reproducer, because in our samples all works

@avently
Copy link

avently commented Mar 25, 2024

Oh, I made a sample and after that noticed that I use dev.icerock.moko:resources-compose:0.24.0-alpha-5
but classpath("dev.icerock.moko:resources-generator:0.23.0"). So it's completely my fault, sorry. When I specified here the latest alpha and restructured project (from resources/MR to moko-resources) I see successful build for both platforms.

Also found how to fix desktop project build in 0.23.0:

applyDefaultHierarchyTemplate()

before sourceSets{}` in common gradle module.
And this fixes Android build:

val androidMain by getting {
      kotlin.srcDir("build/generated/moko/androidMain/src")
...
}

@ExNDY
Copy link
Contributor

ExNDY commented Apr 17, 2024

will be fixed in 0.24.0, please check in 0.24.0-alpha-6

@Alex009
Copy link
Member

Alex009 commented Apr 19, 2024

should be fixed in 0.24.0-beta-1

@Alex009 Alex009 closed this as completed Apr 19, 2024
@Alex009 Alex009 added the bug Something isn't working label Apr 19, 2024
@Alex009 Alex009 mentioned this issue Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants