koush / AndroidAsync

Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.
Other
7.51k stars 1.56k forks source link

Makes no sense! #685

Closed librehome closed 3 years ago

librehome commented 3 years ago

AsyncSSLSocketWrapper.java

Line 491: writeList.add(writeBuf); assert !writeList.hasRemaining();

The assertion will fail! You just added a writeBuf, then you expect the remaining is 0?

librehome commented 3 years ago

I can confirm it is a bug! I guess previous you guys shipped the package with assert stripped. Now all of a sudden it is enable somehow. Expect tons of SSL problems from now on!

aantunovic commented 3 years ago

since android gradle plugin 4.1 assertions are enabled by default in debuggable builds

maybe rebuilding this lib with proguard rule should solve this.

-assumenosideeffects class junit.framework.Assert { *; }
vmalan commented 3 years ago

yeah, this is biting me too. please address! FATAL EXCEPTION: ion-ion
Process: [MYAPP], PID: 22067
java.lang.AssertionError
at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:390)

2501272126 commented 3 years ago

help !!! how can i avoid this bug?

librehome commented 3 years ago

Guys, it's simple!

  1. Clone to repo to local
  2. Delete that line or comment it out. I recommend deleting it.
  3. Add the project to android studio. In build.gradle of app

implementation project(':AndroidAsync')

koush commented 3 years ago

Fixed in 3.1.0

vmalan commented 3 years ago

Thank you. this library has been very useful and essential for many years.

On Sun, Nov 8, 2020 at 10:49 PM Koushik Dutta notifications@github.com wrote:

Fixed in 3.1.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/koush/AndroidAsync/issues/685#issuecomment-723864509, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNAARXRLUXGKW33GNO76ETSO6UIDANCNFSM4TD4MXWQ .