Akka. Android. NoSuchMethodException: <init>

六眼飞鱼酱① 提交于 2019-12-04 01:54:50

问题


When I am running application that uses Akka on Android I receive the following exception:

04-29 16:13:06.235: E/AndroidRuntime(8968): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.MyActivity}: java.lang.NoSuchMethodException: <init> [interface com.typesafe.config.Config, interface akka.event.LoggingAdapter, interface java.util.concurrent.ThreadFactory]

This exception is thrown during actor system creation:

Props props1 = Props.create(MyActor.class);
ActorSystem system = ActorSystem.create("MySystem");

I assumed that proguard removed a constructor, so I added the following line to my proguard.cfg:

-keep class com.typesafe.**  { *; }

but it didn't help.

What am I doing wrong?


回答1:


One of your constructors with the following signature is not public or doesn't exist:

MyActivity (com.typesafe.config.Config, akka.event.LoggingAdapter, java.util.concurrent.ThreadFactory)



回答2:


Expanding on mttdbrd's answer... For those confused how to actually get rid of this warning add the following to your proguard:

-keepclasseswithmembers class * {
    public <init>(com.typesafe.config.Config, akka.event.LoggingAdapter, java.util.concurrent.ThreadFactory);
}


来源:https://stackoverflow.com/questions/23365874/akka-android-nosuchmethodexception-init

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!