Hamamas / Kotlin-Wasm-Html-Interop

jetpack compose wasm interop with html
Apache License 2.0
42 stars 4 forks source link

Unable to import the library in Compose Multiplatform (Jitpack build failed) #1

Open ShreyashKore opened 9 months ago

ShreyashKore commented 9 months ago

Getting the following error when trying to import the dependency in Compose Multiplatform

Could not find com.github.Hamamas:Kotlin-Wasm-Html-Interop:0.0.4-alpha.
  Searched in the following locations:

Build on Jitpack seems to have failed with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'publishToMavenLocal' not found in root project 'KotlinWasmHtmlInterop' and its subprojects.

https://jitpack.io/com/github/Hamamas/Kotlin-Wasm-Html-Interop/0.0.4-alpha/build.log.

Hamamas commented 8 months ago

try to add this dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { mavenCentral() maven { url 'https://jitpack.io' } } }

ShreyashKore commented 8 months ago

I should have mentioned that I'm trying to use it in a Multiplatform project. So I've added this block in my setting.gradle.kts like this

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven("https://jitpack.io")
    }
}

And then I'm importing it in my wasmJsMain dependency block

wasmJsMain.dependencies {
    // ....
    implementation("com.github.Hamamas:Kotlin-Wasm-Html-Interop:0.0.5-alpha")
}

BTW, thanks for this project and I've pushed the code in the branch test/Kotlin-Wasm-Html-Interop for reference.

realityexpander commented 7 months ago

Im having the same issue.

@ShreyashKore It looks like you did not import the jit library in your project, and simply copied the code from this repo. Is this accurate?

I alsp have a project showing how to use google maps in a KMP Compose project for iOS and Android.

ShreyashKore commented 7 months ago

@realityexpander Yes that's correct. I've copied this project in composeWebInterop folder.

realityexpander commented 7 months ago

OK, sounds good!

twissmueller commented 3 months ago

Ran into the same issue today while trying to add it to my Compose Web application.

Could not determine the dependencies of task ':kotlinNpmInstall'.
> Could not resolve all dependencies for configuration ':composeApp:wasmJsNpmAggregated'.
   > Could not find com.github.Hamamas:Kotlin-Wasm-Html-Interop:0.0.5-alpha.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/github/Hamamas/Kotlin-Wasm-Html-Interop/0.0.5-alpha/Kotlin-Wasm-Html-Interop-0.0.5-alpha.pom
       - https://jitpack.io/com/github/Hamamas/Kotlin-Wasm-Html-Interop/0.0.5-alpha/Kotlin-Wasm-Html-Interop-0.0.5-alpha.pom
     Required by:
         project :composeApp

Will do the same as @ShreyashKore and copy over the whole code directly into the project for now.