Making changes within pulled Kryonet into Android Studio

Hello. If I have Kryonet pulled into my Android Studio and Gradie set like this:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile "com.esotericsoftware:kryo:3.0.1"
    compile ("com.esotericsoftware:kryonet:2.22.0-RC1") {
        exclude module : 'kryo'
    }
}

is there any chance that I can make a change within Kryonet’s files and save them?

Already tried with this, but I can’t ‘save’ the file - the changes are not working and the file is marked by dark-blue mark with ‘Changed File’.

Is there any way or I should for the real kryonet into my own repo, make changes and pull?

You’re telling Gradle to pull down Kryo’s version of Kryonet when you run that script, your changes will not stay. Fork the repo, make your changes and then pull that down in Gradle.

Also, Kryonet comes bundled with Kryo, I don’t know why you are mixing and matching versions.

Okay, this is all wrong. I have pulled this to mine own repo, made changes and made a ‘release’ with a tag ‘kryofix1’

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile "com.github.Magic-WoW:kryonet:kryofix1"
}

This is still downloading Kryo from Kryo. The best thing comes, when I download ZIP from my releases - there are changes. In downloaded files from gradle - there aren’t.

What’s in your ‘libs’ folder?

It’s empty.

I’m speaking with a guy, who told me to import his kryonet (with changes), compile it etc. I did it like in his tutorial:

Imgur

Everything should work, all of the paths are okay, but it still shows the wrong UdpConnection file - this from the clean Kryonet:

I have no idea why he’s trying to get you to mix and match versions, that’s a sure way to have tons of potential runtime exceptions.


compile "com.github.Magic-WoW:kryonet:kryofix1"

This is your repo with the fix you need, right? If your repo is set up right, this will download Kryonet + the base Kryo library, which is what you want. So remove the weird imports that guy gave you, use your’s. Then, from a command prompt/terminal, navigate to your project root and type:


gradle build --refresh-dependencies

This will (obviously) run the build and force Gradle to remove cached dependencies. I have a suspicion that Gradle still has the old Kryo downloaded, and it’s doing strange things when trying to compile your version.

Give that a try, let me know if it works.