EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.82k stars 419 forks source link

Fix UDP recieving on Android 5.0+ #111

Closed sylvia43 closed 6 years ago

sylvia43 commented 8 years ago

Tested it, works great on my 5.0 device. This is a fix known by the community (https://github.com/EsotericSoftware/kryonet/issues/106, https://groups.google.com/forum/#!topic/kryonet-users/7l436tftBlo) but for some reason is not in the codebase.

Kogs commented 8 years ago

Please merge the Pull Request.

Philanatidae commented 8 years ago

Confirmed to work as expected on my Android 5.1 device.

shanejansen commented 8 years ago

This breaks kryonet when when running on an iOS device via RoboVM.

CookedApps commented 8 years ago

How do i use this patch in Android Studio with Gradle?

sylvia43 commented 8 years ago

@CookedApps you'd have to download the source, create a new module, and add the fix.

CookedApps commented 8 years ago

@anubiann00b Thanks for the reply, but i managed it by using jitpack.

davjhan commented 8 years ago

@CookedApps Could you explain to us how you did it through jitpack while we wait for this to get merged? Thanks!

CookedApps commented 8 years ago

@davjhan Sorry for my late answer! In your build.gradle file:

  1. Add maven { url "https://jitpack.io" } to your repositories
  2. Add compile "com.github.anubiann00b:kryonet:b6b71d4" to your dependencies -> This refers to the specific commit (b6b71d4) by anubiann00b.

In my case i got a "multiple dex files" exception; so in this case ýou have to exclude kryo from kryonet and add it separately:

compile "com.esotericsoftware:kryo:3.0.3"
compile ("com.github.anubiann00b:kryonet:b6b71d4") {
       exclude module : 'kryo'
}

And thats it!

davjhan commented 8 years ago

@CookedApps Hey! Thanks for the reply! I've tried your directions, but it ends in gradle syncing forever. If I look up the repo in the jitpack website, I get an error that says 'unauthorized'. Is there something I am missing here? Thanks again! capture

sylvia43 commented 8 years ago

I'm assuming that's because Jitpack is compiling the project and Gradle is downloading it? It shouldn't take forever to sync more than once, right?

This URL works for me, even in a new browser: https://jitpack.io/#anubiann00b/kryonet/b6b71d4

davjhan commented 8 years ago

Thank you! I got it to work, i'm guessing it was either android studio or my internet connection. Thanks! also @anubiann00b , thank you for making the branch while this bug gets fixed!

sylvia43 commented 8 years ago

Glad I could help! :smile:

emmett-deen commented 7 years ago

Does anyone have this fix in a jar file style release yet?

midn1 commented 7 years ago

Come on, this request's been waiting for 2 years

Microbius commented 7 years ago

This project is more or less dead. But you are free to fork this project and fix the bugs you want !

NathanSweet commented 6 years ago

@ShaneJansen breaks how? Is there a workaround?

shanejansen commented 6 years ago

@NathanSweet This was a while ago so I don't remember exactly. I do remember that Kryonet would no longer work on iOS via RoboVM (discontinued) after making this change. I didn't really look into it so no workaround that I know of.