Using grpc dependencies in plugin gives errors
Getting the following error
io.grpc.ManagedChannelProvider: Provider io.grpc.netty.NettyChannelProvider not a subtype
I have the following dependencies in the plugin.
'io.grpc:grpc-netty:1.4.0',
'io.grpc:grpc-protobuf:1.4.0',
'io.grpc:grpc-stub:1.4.0',
I see io.grpc.ManagedChannelProvider exists in studio-profiler-grpc-1.0-jarjar.jar(IC-172.3317.76) and grpc-netty which might be creating the above problem.
Any help will be appreciated.
Please sign in to leave a comment.
I also encountered this problem after upgrading the AS to Bumblebee | 2021.1.1.
In Arctic Fox | 2020.3.1, the ClassLoader used to load ManagedChannelProvider is UrlClassLoader:
In Bumblebee | 2021.1.1, the ClassLoader is PluginClassLoader:
Does your plugin depend on 'android' plugin?
No, It doesn't depend on android plugin.
It's strange then. Classes of your plugins are loaded by a separate class loader, which shouldn't see classes from Android plugin. You can debug the code and look which classloader is used to load ManagedChannelProvider's services.
Did you get a solution to this? I am having the same problem with studio-profiler-grpc-1.0-jarjar - it contains the class