westnordost / osmapi

Java client for the OSM API 0.6
GNU Lesser General Public License v3.0
97 stars 19 forks source link

configuration of osmapi on android #29

Closed Fjeldsoe1 closed 3 years ago

Fjeldsoe1 commented 3 years ago

Hey

shouldn't the "configuration" in the readme be "configurations" because I can't get it to work otherwise? And after changing that, I get the following error:

* What went wrong:
Script compilation errors:

  Line 08:     all*.exclude group: 'net.sf.kxml', module: 'kxml2'
                   ^ Expecting an element

  Line 08:     all*.exclude group: 'net.sf.kxml', module: 'kxml2'
                                 ^ Unexpected tokens (use ';' to separate expressions on the same line)

  Line 12:     compile.exclude group: 'org.jetbrains', module:'annotations'
                                    ^ Expecting an element

  Line 12:     compile.exclude group: 'org.jetbrains', module:'annotations'
                                      ^ Unexpected tokens (use ';' to separate expressions on the same line)

  Line 13:     compile.exclude group: 'com.intellij', module:'annotations'
                                    ^ Expecting an element

  Line 13:     compile.exclude group: 'com.intellij', module:'annotations'
                                      ^ Unexpected tokens (use ';' to separate expressions on the same line)

  Line 14:     compile.exclude group: 'org.intellij', module:'annotations'
                                    ^ Expecting an element

  Line 14:     compile.exclude group: 'org.intellij', module:'annotations'
                                      ^ Unexpected tokens (use ';' to separate expressions on the same line)

The code snippet is the configurations from the readme i.e:

configurations {
    // already included in Android
    all*.exclude group 'net.sf.kxml', module: 'kxml2'

    // @NonNull etc annotations are also already included in Android
    cleanedAnnotations
    compile.exclude group: 'org.jetbrains', module:'annotations'
    compile.exclude group: 'com.intellij', module:'annotations'
    compile.exclude group: 'org.intellij', module:'annotations'
}
westnordost commented 3 years ago

oops, yes it should. Weird, how could I have made that mistake, couldn't have been a copy&paste mistake.

But with the "s", it works fine, right?

Fjeldsoe1 commented 3 years ago

The error I wrote in the above comment, is what I get when I just added the "s" to "configuration"

westnordost commented 3 years ago

Do you have a build.gradle.kts or build.gradle?

westnordost commented 3 years ago

Hm there is also missing a colon here:

all*.exclude group: 'net.sf.kxml', module: 'kxml2'
                  ^
Fjeldsoe1 commented 3 years ago

It's build.gradle.kts. I have tried to copy the "configurations" from StreetComplete, and that works (I am still in very early in development of my application)

westnordost commented 3 years ago

Good thinking, I was just writing this post. Could you check if this would work too?

configurations {
    // already included in Android
    all {
        exclude(group = "net.sf.kxml", module = "kxml2")
    }
    // @NonNull etc annotations are also already included in Android
    implementation.configure {
        exclude(group = "org.jetbrains", module = "annotations")
        exclude(group = "com.intellij", module = "annotations")
        exclude(group = "org.intellij", module = "annotations")
    }
}
westnordost commented 3 years ago

(In the future I might want to add those nonnull annotations to improve compatibility with Kotlin, but they need to be removed again due to them being included in Android already. This is why I mention these in the README.md already)

Fjeldsoe1 commented 3 years ago

That seems to work fine! I didn't get any errors

westnordost commented 3 years ago

thanks! I'll update the readme