0

I am using LibGDX for my game, and I am trying to use FastUtil's Int2BooleanArrayMap to store my key states (up/down).

Unfortunately I get this weird error:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: it.unimi.dsi.fastutil.ints.Int2BooleanArrayMap.put(IZ)Ljava/lang/Boolean;
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:131)
Caused by: java.lang.NoSuchMethodError: it.unimi.dsi.fastutil.ints.Int2BooleanArrayMap.put(IZ)Ljava/lang/Boolean;
    at com.acelta.Input.keyDown(Input.kt:12)
    at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:312)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)

The code is very simple for my input processor:

package org.jire.wot

import com.badlogic.gdx.InputAdapter
import it.unimi.dsi.fastutil.ints.Int2BooleanArrayMap
import org.jire.wot.App.camera

object Input : InputAdapter() {

    private val map = Int2BooleanArrayMap()

    override fun keyDown(keycode: Int): Boolean {
        map.put(keycode, true)
        return true
    }

    override fun keyUp(keycode: Int): Boolean {
        map.put(keycode, false)
        return true
    }

    override fun scrolled(amount: Int): Boolean {
        camera.zoom += amount / 13F
        if (camera.zoom < 0.6F) camera.zoom = 0.6F
        else if (camera.zoom > 1F) camera.zoom = 1F
        return true
    }

}

What can I do about this?

Jire
  • 9,680
  • 14
  • 52
  • 87
  • 1
    Does libgdx include a different version of fastutil, perhaps? – user253751 Jun 21 '16 at 03:10
  • @immibis If I remove the FastUtil dependency from my project I can no longer access any of FastUtil, so my guess is no. – Jire Jun 21 '16 at 03:13
  • How exactly are you compiling and running your project? – yole Jun 21 '16 at 08:51
  • Might have something in common with http://stackoverflow.com/questions/37625983/why-is-integer-parameter-of-java-method-mapped-to-int-and-not-platform-type – hotkey Jun 21 '16 at 15:24
  • @yole I use the following Gradle script: https://gist.github.com/Jire/0c14429940f3e04eaeecd578a2e30b13 I am running the project through my libGDX desktop launcher class. – Jire Jun 21 '16 at 18:53
  • @hotkey Very possible! – Jire Jun 21 '16 at 18:54

0 Answers0