I am getting this error message but I don't see anything in the error log
that seems related to classloaders:
02-06 20:07:31.439 28767-28767/com.optrak.there E/AndroidRuntime﹕ FATAL
EXCEPTION: main
Process: com.optrak.there, PID: 28767
java.lang.
ExceptionInInitializerError
at
com.optrak.there.LauncherFragment.onCreate(LauncherFragment.scala:31)
at android.app.Fragment.performCreate(Fragment.java:1678)
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at
android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.Activity.performStart(Activity.java:5240)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at
android.app.ActivityThread.access$800(ActivityThread.java:135)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.typesafe.config.ConfigException$Missing: No
configuration setting found for key 'akka'
at
com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)
at
com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:147)
at
com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)
at
com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)
at
com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:206)
at akka.actor.ActorSystem$Settings.<init>(ActorSystem.scala:168)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:498)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:125)
at com.optrak.there.FSMManager$.<init>(FSMManager.scala:23)
at com.optrak.there.FSMManager$.<clinit>(FSMManager.scala)
at
com.optrak.there.LauncherFragment.onCreate(LauncherFragment.scala:31)
at android.app.Fragment.performCreate(Fragment.java:1678)
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at
android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.Activity.performStart(Activity.java:5240)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at
android.app.ActivityThread.access$800(ActivityThread.java:135)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Maybe the issue is related to proguard. I have included a very minimal
application.conf file and I think proguard is cutting the configuration
file when I install the application. So the app crashes at runtime because
it cannot find such configuration file.
Once I installed get the apk file, I have unzipped it and I cannot see the
application.conf file that is supposed to be there. I am using:
scala 2.10.3
akka-actor 2.3.0-RC2
sbt 0.13.2-M1
My plugins are these
addSbtPlugin("com.hanhuy.sbt" % "sbt-idea" % "1.6.0")
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.2.8")
My minimal application.conf has:
akka {
loglevel = DEBUG
}
I don't know how to tell proguard to keep/include this configuration file.
-include application.conf
doesn't work because proguard chokes with my configuration file.
I really need some help please!! I am very frustrated trying to make this
to work. Maybe I need to something special in my proguard-project.txt, or
my project/Build.scala.
I also tried the approach followed in the safe-metronome project and I
failed:
https://bitbucket.org/mackler/safe-metronome/src/56c08e897cbfc31f664aa3b3a9b56961a5d6befb/project/Build.scala?at=default#cl-18
On Thursday, February 6, 2014 6:01:59 PM UTC-6, Nick Stanchenko wrote:
>
> FYI, if someone bumps into
>
> java.lang.ExceptionInInitializerError
> ...
> Caused by: com.typesafe.config.ConfigException$Missing: No configuration
> setting found for key 'akka'
>
>
> Here’s how I solved it:
>
> 1) If not yet, you need to subclass the Application class with your own
> implementation. See here:
> http://www.devahead.com/blog/2011/06/extending-the-android-application-class-and-dealing-with-singleton/.
>
> I’ll call the new class MyApplication.
>
> 2) InMyApplication, addval config = ConfigFactory.load(). This will use
> the correct class loader.
>
> 3) When creating the the actor system, supply this config and
> application’s class loader by hand (the code assumes you are inside an
> Activity):
> val app = getApplication.asInstanceOf[MyApplication]
> val actorSystem = ActorSystem("MyActorSystem", app.config,
> app.getClassLoader)
>
> N
>
> On Sunday, December 15, 2013 11:28:56 PM UTC, Nick Stanchenko wrote:
>>
>> Hi,
>>
>> Since I spent almost an entire day adding Proguard rules for the latest
>> Akka, I thought I would share them.
>> There is a pull request to add this to the cookbook:
>> https://github.com/fxthomas/android-plugin/pull/6
>>
>> proguardOptions ++= Seq(
>> "-keep class akka.actor.LightArrayRevolverScheduler { *; }",
>> "-keep class akka.actor.LocalActorRefProvider { *; }",
>> "-keep class akka.actor.CreatorFunctionConsumer { *; }",
>> "-keep class akka.actor.TypedCreatorFunctionConsumer { *; }",
>> "-keep class akka.dispatch.BoundedDequeBasedMessageQueueSemantics { *; }",
>> "-keep class akka.dispatch.UnboundedMessageQueueSemantics { *; }",
>> "-keep class akka.dispatch.UnboundedDequeBasedMessageQueueSemantics { *;
>> }",
>> "-keep class akka.dispatch.DequeBasedMessageQueueSemantics { *; }",
>> "-keep class akka.actor.LocalActorRefProvider$Guardian { *; }",
>> "-keep class akka.actor.LocalActorRefProvider$SystemGuardian { *; }",
>> "-keep class akka.dispatch.UnboundedMailbox { *; }",
>> "-keep class akka.actor.DefaultSupervisorStrategy { *; }",
>> "-keep class akka.event.slf4j.Slf4jLogger { *; }",
>> "-keep class akka.event.Logging$LogExt { *; }")
>>
>>
--
You received this message because you are subscribed to the Google Groups
"scala-on-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.