【问题标题】:Dispatch library on AndroidAndroid 上的调度库
【发布时间】:2015-07-21 08:59:38
【问题描述】:

尝试通过 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)

前面有几千行。 android:compile 添加或不添加 Dispatch 都可以正常工作。

查看dispatch-classic 文档表明 Dispatch 在 Android 上不能很好地工作,但提到“未来迁移到不同的后端”(可能在最新版本的 dispatch 中实现)将纠正这个问题。

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

问题还存在吗?我应该只使用不同的库吗?是否可以修改我的proguard-sbt.txt 以确保android:package 可以运行?

【问题讨论】:

    标签: android scala sbt proguard


    【解决方案1】:

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

    话虽如此,看来 Dispatch 的重载依赖确实给 Android 开发管道带来了问题:运行 android:package 会最大化我的所有 6 个 CPU 并使用 > 1 GB 的内存。我已经超过了 65k dex 限制。我想我会朝着不同的方向前进。

    【讨论】:

      猜你喜欢
      • 2017-03-09
      • 2018-03-13
      • 1970-01-01
      • 1970-01-01
      • 2014-09-25
      • 2014-01-19
      • 1970-01-01
      • 2012-06-22
      • 2012-06-24
      相关资源
      最近更新 更多