JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.24k stars 1.18k forks source link

I wanted to add a Javacv dependency, but the IDE never recognized it. #1901

Closed kirin233x closed 1 month ago

kirin233x commented 2 years ago

I built a Compose Desktop application, I tried to add dependency by this way:

import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.5.31"
    id("org.jetbrains.compose") version "1.0.0"
}

group = "com.quick"
version = "1.0"

repositories {
    google()
    mavenCentral()
    maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}

dependencies {
    implementation(compose.desktop.currentOs)
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "11"
}

compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "ComposeSample"
            packageVersion = "1.0.0"
        }
        dependencies {
        }
    }
}

but it's not work. and I tried to add the dependency in the application scope. but it still not work. the ide cannot recognize the javacv code.

application {
        mainClass = "MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "ComposeSample"
            packageVersion = "1.0.0"
        }
        dependencies {
           implementation("org.bytedeco:javacv-platform:1.3.1")  //this way
        }
    }

Finally, I add the dependency by the project structure, add the dependency to the Module->main. The program runs without problem, but the ide cannot recognize the javacv code either.

i'm confused.

something with my net connect, I cannot post a picture to the github...

akurasov commented 2 years ago

Have you tried it this way?

dependencies { implementation(compose.desktop.currentOs) implementation("org.bytedeco:javacv-platform:1.3.1") }

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.