我觉得你的痛苦我花了小时,试图让sbt,proguard,scala,akka工作,并建议您从这里查看项目/ Build.scala:
github/fehguy/swagger -for-the-home / tree / master / android
具体来说, proguard 选项: / p>
Android中的proguardOption:= | -dontwarn scala ** | -keepclassmembers class * { | ** MODULE $; |} | -keep class scala.collection.SeqLike { | public protected *; | | -keep public class * extends android.app.Activity | -keep public class * extends android.app.Application | -keep public class * extends android.app.Service | -keep public class * extends android.content.BroadcastReceiver | -keep public class * extends android.content.ContentProvider | -keep pub public class * extends android.app.backup.BackupAgentHelper | -keep public class * extends android.preference.Preference | -keep public class com.android.vending.licensing.ILicensingService | -keep public class org.eatbacon.sfth.AnalogUpdateActivity | -keep public class org.eatbacon.sfth.UpdateDataTask | -keep public class org.eatbacon.sfth.ShowChartActivity | | -keepclasseswithmembernames class * { | native< methods> ;; |} | | -keepclasseswithmembernames class * { | public< init>(android.content.Context,android.util.AttributeSet); |} | | -keepclasseswithmembernames class * { | public< init>(android.content.Context,android.util.AttributeSet,int); |} | | -keepclassmembers枚举* { | public static ** [] values(); | public static ** valueOf(java.lang.String); |} | | -keep class *实现android.os.Parcelable { | public static final android.os.Parcelable $ Creator *; |} .stripMargin)
I'm a little bit desperate at the moment. I'm trying to use an Akka project (written in scala) under Android (in Eclipse), but whatever I try, I can't make it work. For simplicity I created two projects: One Akka project, created using sbt eclipse and then imported to eclipse, and one standard android project using the project creation wizard. I can reference the Akka-code from the android code, but at Runtime I always get a NoClassDefFoundError. I would really appreciate if someone could point out what I'm doing wrong or what I could in general do to use my Akka project in my Android app.
解决方案I feel your pain. I spent hours trying to get sbt, proguard, scala, akka to work, and recommend you take a look at the project/Build.scala from here:
github/fehguy/swagger-for-the-home/tree/master/android
Specifically the proguard options:
proguardOption in Android := """ |-dontwarn scala.** |-keepclassmembers class * { | ** MODULE$; |} |-keep class scala.collection.SeqLike { | public protected *; |} |-keep public class * extends android.app.Activity |-keep public class * extends android.app.Application |-keep public class * extends android.app.Service |-keep public class * extends android.content.BroadcastReceiver |-keep public class * extends android.content.ContentProvider |-keep public class * extends android.app.backup.BackupAgentHelper |-keep public class * extends android.preference.Preference |-keep public class com.android.vending.licensing.ILicensingService |-keep public class org.eatbacon.sfth.AnalogUpdateActivity |-keep public class org.eatbacon.sfth.UpdateDataTask |-keep public class org.eatbacon.sfth.ShowChartActivity | |-keepclasseswithmembernames class * { | native <methods>; |} | |-keepclasseswithmembernames class * { | public <init>(android.content.Context, android.util.AttributeSet); |} | |-keepclasseswithmembernames class * { | public <init>(android.content.Context, android.util.AttributeSet, int); |} | |-keepclassmembers enum * { | public static **[] values(); | public static ** valueOf(java.lang.String); |} | |-keep class * implements android.os.Parcelable { | public static final android.os.Parcelable$Creator *; |} """.stripMargin)
更多推荐
如何在Android下使用Akka项目
发布评论