hoijui / JavaOSC

OSC content format/"protocol" library for JVM languages
http://www.illposed.com/software/javaosc.html
BSD 3-Clause "New" or "Revised" License
156 stars 43 forks source link

Android studio can't find java.awt.Color #51

Closed WouterVisser closed 4 years ago

WouterVisser commented 4 years ago

When using this project on Android studio, when trying to send a message using an OSCPortOut, I get an NoClassDefFoundException for java.awt.Color, which is necessary for the serializer. Is there any way to fix this?

Burtan commented 4 years ago

Either use version 0.4 or use my custom version, which is unfortunately not available via maven, as I'm waiting for the pull request to be accepted: https://github.com/hoijui/JavaOSC/pull/49 Or this workaround: https://github.com/hoijui/JavaOSC/issues/43

hoijui commented 4 years ago

solved by pull request https://github.com/hoijui/JavaOSC/pull/49 by @Burtan, now merged into master

Burtan commented 4 years ago

Any plans about releasing this with 0.7?

hoijui commented 4 years ago

good idea! for now I made a SNAPSHOT-0.7 release.

Burtan commented 4 years ago

Not sure if I'm doing something wrong or the release didn't work. I have added the snapshot sonatype repository and could find: "com.illposed.osc", "javaosc-parent", "0.7-SNAPSHOT" but not "com.illposed.osc", "javaosc-core", "0.7-SNAPSHOT" Until now I had the dependency on "com.illposed.osc", "javaosc-core", "0.6" But the parent module doesn't seem to have the core as a dependency. I'm using gradle 6.2.2

hoijui commented 4 years ago

Took me some time too, but.. you would have to add the nexus/sonatype snapshot repository in your gradle file. in maven it goes like this:

pom.xml:

    <repositories>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

in build.gradle, (I think) like this:

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
        mavenContent {
            snapshotsOnly()
        }
    }
}
Burtan commented 4 years ago

The problem is not the repository but the javaosc core module missing from the repo?

hoijui commented 4 years ago

well... it worked for me like this (using maven). after deleting the locally installed snapshot versions, it downloaded it from that repo. maybe the gradle code is wrong then?

Burtan commented 4 years ago

Yeah, the repo looks fine: https://oss.sonatype.org/content/repositories/snapshots/com/illposed/osc/ So it must be gradle. I'll keep you updated when I find the problem.

Burtan commented 4 years ago

This works implementation("com.illposed.osc", "javaosc-core", "0.7-20200407.165423-5") Seems to be some weird gradle SNAPSHOT interaction.

Anyway, it works with Android API 21 :thumbsup:

hoijui commented 4 years ago

thank you! :-) ... and that is indeed very strange.. and very unpractical! how would I tell someone to use the latest snapshot in gradle? how could we document it?