onionshare / onionshare-android

Android version of OnionShare
https://onionshare.org/
GNU General Public License v3.0
141 stars 16 forks source link

Upgrading to AGP 8.x breaks Netty somehow #107

Open grote opened 8 months ago

grote commented 8 months ago

Upgrading the Android Gradle Plugin to 8.x (e.g. https://github.com/onionshare/onionshare-android/commit/af97116d87204d0d09a25a599e6dc98059986fed) causes Netty to present some wierdness. At some point it stops to answer requests and logs those exceptions:

i.n.c.Defa...elPipeline org.onionshare.android               W  An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.io.netty.channel.ChannelPipelineException: io.ktor.server.netty.NettyChannelInitializer is not a @Sharable handler, so can't be added or removed multiple times.
                    at io.netty.channel.DefaultChannelPipeline.checkMultiplicity(DefaultChannelPipeline.java:600)
                    at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:202)
                    at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:381)
                    at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:370)
                    at io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor.channelRead(ServerBootstrap.java:209)
                    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
                    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
                    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
                    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
                    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
                    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
                    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
                    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97)
                    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
                    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
                    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
                    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
                    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
                    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
                    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:296)
                    at io.ktor.server.netty.EventLoopGroupProxy$Companion.$r8$lambda$XgnKz7L6tCWRUaIAa7SVURwtFE4(NettyApplicationEngine.kt:0)
                    at io.ktor.server.netty.EventLoopGroupProxy$Companion$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:0)
                    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
                    at java.lang.Thread.run(Thread.java:1012)