onionshare/onionshare-android

Upgrading to AGP 8.x breaks Netty somehow

grote opened this issue · 1 comments

grote commented

Upgrading the Android Gradle Plugin to 8.x (e.g. af97116) 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)