westnordost/osmapi

configuration of osmapi on android

Closed this issue · 9 comments

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'
}

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?

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

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

Hm there is also missing a colon here:

all*.exclude group: 'net.sf.kxml', module: 'kxml2'
                  ^

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)

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")
    }
}

(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)

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

thanks! I'll update the readme