Android-Color-Picker icon indicating copy to clipboard operation
Android-Color-Picker copied to clipboard

[BUG] error: cannot access KMappedMarker

Open jpage4500 opened this issue 5 years ago • 3 comments

This one is confusing me.. I was using the color picker just fine yesterday and now today the project is failing to build with the compiler error:

/Users/jpage/working/projects/hubitat-dashboard/app/src/main/java/com/jpage4500/hubitat/ui/fragments/DashboardFragment.java:654: error: cannot access KMappedMarker
        group.registerPicker(dialogLayout.colorSeekBar);
             ^
  class file for kotlin.jvm.internal.markers.KMappedMarker not found

It's complaining about the lines here:

        PickerGroup<IntegerHSLColor> group = new PickerGroup<>();
        group.registerPicker(dialogLayout.colorSeekBar);
        group.registerPicker(dialogLayout.saturationSeekBar);
        group.registerPicker(dialogLayout.lightnessSeekBar);

I imagine this isn't related to your library since it was building just fine yesterday. But, I can't figure out what changed or why it's now all of the sudden failing to compile so I figured someone here might have an idea why

jpage4500 avatar Jun 19 '20 15:06 jpage4500

FWIW - I did notice when implementing this that there was no 'registerPickers' method like is shown in the example. My app is in Java and not Kotlin though. Anyway, registerPicker() did work just fine but figured I'd mention that too..

// Group pickers with PickerGroup to automatically synchronize color across them
val group = PickerGroup<IntegerHSLColor>().also {
  it.registerPickers(
    hueSeekBar,
    saturationSeekBar,
    lightnessSeekBar,
    alphaSeekBar
  )
}

jpage4500 avatar Jun 19 '20 15:06 jpage4500

So, I got it to build again. I looked at the build.config files in the demo project and added these lines to mine:

apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"

and

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"

The crazy thing is.. why it has been working without them.. Guessing this is just a Kotlin thing though and not related to this project

I did see that Android Studio updated a kotlin plugin/library recently so maybe that's related

jpage4500 avatar Jun 19 '20 15:06 jpage4500

@jpage4500, thank you for reporting this. Wonderful! Great catch on registerPickers, I will check the docs and API. I will also double-check on what plugins/classpath are needed to make it work with Java and add that to the docs too 👍

smelfungus avatar Jun 19 '20 16:06 smelfungus