I have a couple of ideas for some plugins on sponge.
Since I already did some android programming I decided to use gradle but for some reason I can’t get it to work.
The error I get while I try to rebuild or build an artifact:
java: cannot access com.google.common.reflect.TypeToken
class file for com.google.common.reflect.TypeToken
After some googling I noticed that this should happen when com.google.guava is missing but when I check the external libraries it is there.
It errors on the line:
config.getNode(“placeholder”).setValue(true);
Sponge has a Gradle plugin. Just add to your build.gradle
plugins {
id 'org.spongepowered.plugin' version '0.5.2'
}
This does a bunch of the setup for you. All you need after that is group, version, and dependencies.
Second, 4.1.0 is officiallly released now. You can get rid of ‘-SNAPSHOT’.
Maybe for whatever reason, guava’s not on the classpath for the version 4.1.0-SNAPSHOT is currently representing.
Doesn’t matter, it doesn’t make any difference. The strange thing is that I have an example plugin which is exactly the same, except for the name, which works and I can’t find what differs.
Later this day I will post both codes, I am now on my phone.
Again this line:
config.getNode(“placeholder”).setValue(true);
gives the error:
java: cannot access com.google.common.reflect.TypeToken
class file for com.google.common.reflect.TypeToken not found
Just out of curiosity, can you see what happens when you use this as a build.gradle for a brand new project?
plugins {
id 'org.spongepowered.plugin' version '0.5.2'
}
group 'com.example'
version '1.0'
dependencies {
compile 'org.spongepowered:spongeapi:4.1.0'
}
It is during compile time, when I try to build an artifact of during rebuild.
I am using IntelliJ IDEA Community Edition. This is the first time I am using IntelliJ but I familiar with Android Studio which is almost the same.
I have to admit that’s odd. It’s possible you accidentally tweaked some setting in intellij (maybe?)
Assuming the control mappings are still the same, crtl->click on TypeToken (anywhere in your code) in intellij. See if the class actually exists in the environment somewhere.
I know but when I ctrl+click it it goes to some interfaces, I can’t find the TypeTokens class manually but it is in the external libraries beneath the google guava