2014-12-22 88 views
2

在我的項目中,我想使用遠程演員,並已成功嘗試並測試它們作爲Scala-SBT項目。無法啓動活動:找不到關鍵字'akka.version'的配置設置

但是,當我試圖在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(),但它沒有工作

對此請幫助。

回答

0

好的,我知道proguard是從我的akka​​演員中刪除reference.conf。因此,我在資源文件夾中創建了reference.conf,併合並了兩個reference.conf的內容(一個來自akka-actor,另一個來自akka-remote)。現在它起作用了。

+0

並且出現這個新錯誤... 引起:java.lang.NoSuchMethodException: [class akka.actor.ExtendedActorSystem,class akka.remote.RemoteActorRefProvider] – user2730066