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

IDE error #41

Open
Shabinder opened this issue Apr 24, 2023 · 5 comments
Open

IDE error #41

Shabinder opened this issue Apr 24, 2023 · 5 comments

Comments

@Shabinder
Copy link
Contributor

Cannot access 'dev.icerock.moko.parcelize.Parcelable' which is a supertype of 'in.shabinder.soundbound.models.SongModel'. Check your module classpath for missing or conflicting dependencies

shared module's commonMain has moko parcelize as an api

Any ideas ?

@Shabinder
Copy link
Contributor Author

Compilation works fine, latest Stable Intellij + Android Studio both show red error highlightning.

@Alex009
Copy link
Member

Alex009 commented Apr 26, 2023

if you add moko-parcelize directly to module where you see this error - error fixes or not?

@Shabinder
Copy link
Contributor Author

Nope.

@burntcookie90
Copy link

I've also been running into this and its causing further problems because auto-updating of compose previews will not trigger.

@burntcookie90
Copy link

just a heads up, kotlin 2.0 has official support for the functionality provided by this library.

targets.configureEach {
    val isAndroidTarget = platformType == KotlinPlatformType.androidJvm
    compilations.configureEach {
      compileTaskProvider.configure {
        compilerOptions {
          freeCompilerArgs.addAll(
            "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
            "-Xexpect-actual-classes", // used for Parcelize in tests
          )
          if (isAndroidTarget) {
            freeCompilerArgs.addAll(
              "-P",
              "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=com.example.parcelize.Parcelize",
            )
          }
        }
      }
    }
  }

You can then annotate your KMP models with your custom parcelize annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants