SrSouza
11/01/2018, 2:56 PM[11:53:05 ERROR]: Error occurred while enabling KotlinBukkitAPI v0.1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalAccessError: tried to access method kotlin.collections.ArraysKt___ArraysJvmKt.copyOfRange([Ljava/lang/Object;II)[Ljava/lang/Object; from class kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance
at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:217) ~[?:?]
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:106) ~[?:?]
at kotlin.reflect.jvm.internal.KMutableProperty1Impl.set(KProperty1Impl.kt:59) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.dsl.config.KConfig.loadRecursive(ConfigDSL.kt:392) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.dsl.config.KConfig.loadAndSetDefaultR(ConfigDSL.kt:142) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.dsl.config.KConfig.loadAndSetDefault(ConfigDSL.kt:96) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.dsl.config.ConfigDSLKt.loadAndSetDefault(ConfigDSL.kt:63) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.dsl.config.ConfigDSLKt.loadAndSetDefault$default(ConfigDSL.kt:61) ~[?:?]
at br.com.devsrsouza.kotlinbukkitapi.KotlinBukkitAPI.onEnable(KotlinBukkitAPI.kt:25) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) ~[1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at br.com.devsrsouza.pluginlauncher.Main.lambda$onEnable$0(Main.java:32) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [1.8.8.jar:git-Spigot-21fe707-e1ebe52]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
ilya.gorbunov
11/01/2018, 3:25 PMkotlin-reflect
library that you're actually using at run time?SrSouza
11/01/2018, 3:29 PMkotlin
plugins {
kotlin("jvm") version "1.3.0"
.....
}
....
dependencies {
......
compile(kotlin("reflect"))
}
I made a test, just downgrading the version to 1.2.60, this exception don't appearilya.gorbunov
11/01/2018, 3:45 PMkotlin-stdlib:1.3.0
but using kotlin-stdlib:1.2.x
in runtime.SrSouza
11/01/2018, 5:02 PMkotlin
fun main() {
for (prop in test::class.memberProperties.filterIsInstance<KMutableProperty1<Any, Any>>()) {
if(prop.name.equals("texto", true)) {
println("ehnois")
prop.set(test, "something")
}
}
println(test)
}
object test {
var texto = "aaaa"
var id = 15152063
override fun toString(): String {
return "test(texto='$texto', id=$id)"
}
}
Same error in prop.set
ilya.gorbunov
11/01/2018, 6:14 PMkotlin-reflect:1.2.60
works fine with kotlin-stdlib:1.2.60
and kotlin-reflect:1.3.0
doesn't — it requires kotlin-stdlib:1.3.0
in runtime.
Is this test enough to reproduce the problem or some special setup is needed?SrSouza
11/01/2018, 6:24 PMkotlin
plugins {
id("java")
id("maven-publish")
kotlin("jvm") version "1.3.0"
id("com.github.johnrengelman.shadow") version "4.0.2"
}
dependencies {
compile(kotlin("stdlib", "1.3.0"))
compile("org.jetbrains.kotlin:kotlin-reflect:1.3.0")
//compile(kotlin("reflect", "1.3.0")) this is working too
compile("com.comphenix.attribute:AttributeStorage:0.0.2-SNAPSHOT")
}
tasks {
"compileKotlin"(KotlinCompile::class) {
kotlinOptions {
jvmTarget = "1.8"
}
}
"shadowJar"(ShadowJar::class) {
baseName = project.name
classifier = null
dependencies {
include(dependency("org.jetbrains.kotlin:kotlin-stdlib:1.3.0"))
include(dependency("org.jetbrains.kotlin:kotlin-reflect:1.3.0"))
include(dependency("com.comphenix.attribute:AttributeStorage:0.0.2-SNAPSHOT"))
}
}
}
jdiaz
11/01/2018, 7:32 PMcompile(kotlin-reflect)
it'll use the version from your IDE iirc, so by just adding the version explicitly it's fine. It should also work by updating the version in the IDE (I had this problem too)