运行sbt install-emulator时出错

Mic*_*rds 6 java android scala sbt sbt-android-plugin

我正在关注此页面上的视频http://zegoggl.es/2009/12/building-android-apps-in-scala-with-sbt.html,它们使用SBT创建一个Android项目.但是,我试图使用安装模拟器

sbt install-emulator
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

    [info] Nothing to compile.
    [info]   Post-analysis: 1 classes.
    [info] == tests / compile ==
    [info]
    [info] == awesomepad / proguard ==
    ProGuard, version 4.4
    ProGuard is released under the GNU General Public License. The authors of all
    programs or plugins that link to it (sbt, ...) therefore
    must ensure that these programs carry the GNU General Public License as well.
    Reading program directory [C:\Projects\Scala\sbt2test\awesomepad\target\scala_2.
    9.1\classes]
    java.io.IOException: Can't read [proguard.ClassPathEntry@550a17fb] (Can't proces
    s class [com/kickass/awesomepad/R$attr.class] (Unsupported version number [51.0]
     for class format))
            at proguard.InputReader.readInput(InputReader.java:230)
            at proguard.InputReader.readInput(InputReader.java:200)
            at proguard.InputReader.readInput(InputReader.java:178)
            at proguard.InputReader.execute(InputReader.java:78)
            at proguard.ProGuard.readInput(ProGuard.java:195)
Run Code Online (Sandbox Code Playgroud)

Sal*_*lil 4

我遇到过同样的问题。我意识到这是因为我使用的是 JDK 1.7。虽然使用 1.6 创建的 jar 可在 1.7 上运行,但 1.6 jar 的 proguard 不适用于 1.7 jar。目前,Proguard 1.7 仅提供 Beta 版。因此,android 工具和 Maven 存储库具有适用于 1.6 jar 的 proguard。当它尝试修剪 1.7 jar 时,它会抛出该错误。

为了解决这个问题,我降级到 JDK 1.6,卸载了 1.7,并确保我的 jar 是由 1.6 JDK 工具创建的。

为了从本地存储库中删除 1.7 jar,我刚刚删除了 ~/.ivy2 下的目录并使用该插件重新创建了 android 项目。我只是按照 Android 插件的自述文件进行操作。