Unable to start Activity:No configuration setting found for key 'akka.version'

851 views Asked by At

In my project, I wanted to use remote actors and have successfully tried and tested them as a Scala-SBT project.

But, when I tried to do the same in Android. The following error cropped up

com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version'

Here's the Code which is loading the configuration and which used to work in Scala-SBT project

val hostname="192.168.137.230"
val custom=ConfigFactory.parseString(
  "akka {\n   " +
    "actor {\n     " +
    "provider = \"akka.remote.RemoteActorRefProvider\"\n   }\n   " +
    "remote {\n     " +
    "enabled-transports = [\"akka.remote.netty.tcp\"]\n     " +
    "netty.tcp {\n       " +
    "hostname = \""+hostname+"\"\n       " +
    "port = 2551\n     }\n   }\n }"
)
val system = ActorSystem("RemoteSystem",ConfigFactory.load(custom))

The problem which seems apparent to me is that the akka.remote's reference.conf is not being used.

PS: I did try copying the contents of akka.remote's reference.conf to ConfigFactory.parseString() but it didn't work

Please help regarding this.

1

There are 1 answers

1
user2730066 On

Ok, so I learnt that proguard was removing the reference.conf from my akka-actor. So, I made a reference.conf in the resources folder and merged the contents of the two reference.conf(one from akka-actor and the other from akka-remote). And it works now.