I'm trying to run the packageReleaseDeb task but i...
# compose-desktop
z
I'm trying to run the packageReleaseDeb task but it fails with this error
Error: Invalid or unsupported type: [deb]
. Same with rpm. I'm developing on linux so shouldn't it be working?
e
It is working fine for me. Have you added:
targetFormats(TargetFormat.Deb)
to your build file? If so, maybe you can share the your build file.
z
Yes,
Copy code
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
    kotlin("jvm") version "1.7.10"
    id("org.jetbrains.compose") version "1.2.0-beta01"
}

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

dependencies {
    @Suppress("OPT_IN_IS_NOT_ENABLED")
    @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
    implementation(compose.material3)
    implementation(compose.desktop.linux_x64)
    implementation(compose.materialIconsExtended)

    implementation("com.github.ajalt.clikt:clikt:3.5.0")
}

compose.desktop {
    application {
        mainClass = "zt.tau.MainKt"

        nativeDistributions {
            packageName = "tau"
            packageVersion = "1.0.0"

            targetFormats(TargetFormat.AppImage, TargetFormat.Deb)
        }
    }
}
e
That is more or less identical to what I have. If we disregard that you use m3, but that shouldn't affect anything. Do you get the same issue with
packageDeb
? The only other thing I can think it is which version of JDK you're using?
Maybe a gradle clean might help as well.
z
Clean and packageDeb didn't fix it
I'm using JDK 18
e
I've also set two root attributes that you have not:
Copy code
root = ""
version = ""
I'm gonna try JDK 18 and see if I get the same error
However, I commented that out and it still works. I'm using Azul JDK18, both for the project and Gradle VM. Not sure which one you're using, but maybe you can try that one instead otherwise. Are you running the command from within IntelliJ? Or commandline?
z
I'm using OpenJDK and I'm running the command from within intellij
e
Weird. You look to have an identical setup, but with different results. However, I did just get the error with rpm
Maybe it depends on your own distribution of Linux? that is my best guess when .deb works and not .rpm.
z
I'm using arch linux if that helps any
e
Yeah I think that might be it. My distrib. is debian-based and I can build a debian binary but not rpm binary. Maybe with the right dependencies installed I can build an rpm. I suggest googling jpackage and arch linux. What I can tell is that you can't build an rpm from MacOS, or rather it builds a MacOS App 😄
z
Ah ok. So for rpm I had to install
rpm-tools
and for deb i had to install
dpkg
. Then the errors go away Maybe that information should go on the documentation for packaging?
e
Yeah, I think so. I suggest that you file a bug on the github compose tracker. It's tricky to figure out from that error alone.
z
Thanks for the help!
e
Glad you got it sorted out! and now I know what to do in that situation 🙂
280 Views