0
\$\begingroup\$

I added Kryonet to my libgdx project like this...

Created a "libs" folder in core project, droped kryonet.jar in there. In build.gradle of the root project added this line:

project(":core") {
   ...
   dependencies {
    ...
    compile fileTree(dir: 'libs', include: '*.jar')
   }
}

But I keep seeing "arg" instead of the variable names

enter image description here

When I try to see the class this is what it shows:

enter image description here

No button to attach source is being displayed.. Any Ideas?

\$\endgroup\$
1
\$\begingroup\$

I'm not an expert, but I believe the problem is that you're only including the binaries, so your IDE can't figure out what the original variable names were. If you include the source code as well, that lets your IDE be a little smarter.

I would propose an alternative implementation- instead of putting those JAR files in a libs directory, add them to your gradle file as maven imports instead as follows:

project(":core") {
    apply plugin: "java"


    dependencies {
        // ... your other compile lines here
        // Add the kryonet line below:
        compile "com.esotericsoftware:kryonet:2.22.0-RC1"
    }
}

This appears to add everything the IDE needs to both import the code and label the parameters.

\$\endgroup\$
  • \$\begingroup\$ This worked, I have a question, where in https://github.com/EsotericSoftware/kryonet you found that string? com.esotericsoftware:kryonet:2.22.0-RC1 cuz I was looking for this and couldnt find it so I did the libs folder method \$\endgroup\$ – centenond Nov 21 '16 at 1:36
  • \$\begingroup\$ I actually didn't- I went to https://search.maven.org and searched for kryonet. The first entry seemed to be the library I wanted, and from there the gradle syntax is compile "<groupid>:<artifactid>:<version>" \$\endgroup\$ – John Nov 21 '16 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.