【问题标题】:Unable to start Activity:No configuration setting found for key 'akka.version'无法启动活动:找不到密钥“akka.version”的配置设置
【发布时间】:2015-02-21 00:04:05
【问题描述】:

在我的项目中,我想使用远程演员,并成功地尝试和测试了它们作为 Scala-SBT 项目。

但是,当我尝试在 Android 中做同样的事情时。出现以下错误

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

这是加载配置并用于 Scala-SBT 项目的代码

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))

对我来说似乎很明显的问题是 akka.remote 的 reference.conf 没有被使用。

PS:我确实尝试将 akka.remote 的 reference.conf 的内容复制到 ConfigFactory.parseString() 但它不起作用

请帮助解决这个问题。

【问题讨论】:

    标签: android scala akka akka-remote-actor


    【解决方案1】:

    好的,所以我了解到 proguard 正在从我的 akka-actor 中删除 reference.conf。所以,我在资源文件夹中创建了一个reference.conf,并合并了两个reference.conf的内容(一个来自akka-actor,另一个来自akka-remote)。它现在有效。

    【讨论】:

    • 出现了这个新错误... 原因:java.lang.NoSuchMethodException: [class akka.actor.ExtendedActorSystem, class akka.remote.RemoteActorRefProvider]
    猜你喜欢
    • 2015-09-09
    • 2016-06-18
    • 2023-03-21
    • 2017-08-25
    • 2017-10-29
    • 2015-12-23
    • 2018-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多