Android上的调度库

时间:2015-05-10 23:43:24

标签: android scala sbt proguard

尝试通过SBT构建Android应用,我发现我可以android:package就好了,除非我将"net.databinder.dispatch" %% "dispatch-core" % "0.11.2"添加到libraryDependencies。如果我添加它,那么我得到以下(极长)Proguard错误(full text):

Note: org.jboss.netty.util.internal.ByteBufferUtil: can't find dynamically referenced class java.nio.DirectByteBuffer
Note: org.jboss.netty.util.internal.ByteBufferUtil: can't find dynamically referenced class sun.misc.Cleaner
Note: there were 2 unresolved dynamic references to classes or interfaces.
Warning: there were 1828 unresolved references to classes or interfaces.
      You should check if you need to specify additional program jars.
         You may need to add missing library jars or update their versions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 7 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile the code.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: there were 8 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)

前面有几千行。无论是否添加了Dispatch,android:compile都可以正常工作。

查看dispatch-classic文档表明Dispatch与Android不兼容,但提到“未来移动到不同的后端”(可能在最新版本的调度中实现)将纠正这一点。

我找不到任何有关Dispatch和Android的信息,除了dispatch-classic可用的信息。

问题是否仍然存在?我应该使用不同的库吗?是否可以修改我的proguard-sbt.txt以确保android:package可以投放?

1 个答案:

答案 0 :(得分:0)

似乎Dispatch现在可以很好地与Android配合使用。我之前的问题是,我不知道,我的proguard设置是由sbt为每次编译重新生成的。在我的.sbt文件中将-donwarn **添加到我的proguardOptions可修复上述错误(尽管我可能会追踪将来需要-dontwarn'的更具体的包。)

话虽如此,似乎Dispatch的重型依赖关系确实给Android开发管道带来了问题:运行android:package最大限度地利用我的所有6个CPU并使用> 1 GB内存。我超过65k dex限制。我想我会走另一个方向。