Error starting sbt install-emulator

I follow the video on this page http://zegoggl.es/2009/12/building-android-apps-in-scala-with-sbt.html that use SBT to create an Android project. However, I am trying to install the emulator using

sbt install-emulator 

And I get the following error:

  [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) 
+6
source share
5 answers

I had the same problem. I realized that this is because I used JDK 1.7. Although the jars created with 1.6 work at 1.7, the proguard for 1.6 jars does not work with 1.7 jars. Currently, only Proguard beta versions for 1.7 are available. So, android tools and maven repositories have proguard for 1.6 jars. When he tries to cut 1.7 jars, he gives this error.

To solve this problem, I dropped to JDK 1.6, uninstalled 1.7, and made sure my banks were created using 1.6 JDK tools.

To remove 1.7 jars from the local repository, I simply deleted the directories in ~ / .ivy2 and re-created the Android project using the plugin. And I just followed README for the android plugin for tee.

+4
source

As the page you're linking to is referenced, "Note: this article has not been updated or expired. For doubt, refer to the README from sbt-android-plugin." Here the readme ( README.md ) contains only a set of instructions that I could find that really work with the current versions of scala, sbt and the Android SDK.

I only needed to do some tricks to get it working:

  • Change your sbt script (maybe ~ / bin / sbt) and add the parameter "-XX: MaxPermSize = 512m", otherwise you will end the PermGen space
  • Be sure to use the 0.10 pattern (default) instead of 0.11, which you can specify.
  • Make sure you go to the "Hacking in the plugin" section when it tells you.

Hope this helps.

+2
source

For me, the description on the plugins site is enough: link .

Have you tried to do it this way?

0
source

Since obviously jdk1.7 is incompatible, I had the same problem. In my build.scala file, I added the following line:

 javaHome := Some(file("c:\\Program Files\\Java\\jdk1.6.0_35")) 

and then he worked.

0
source

I got the error "(unsupported version number [51.0] for class format)" with java version "1.7.0_51".

This issue was fixed by adding javac compatibility string in Build.scala:

 val settings = Defaults.defaultSettings ++ Seq ( ... javacOptions ++= Seq("-encoding", "UTF-8", "-source", "1.6", "-target", "1.6") ) 
0
source

Source: https://habr.com/ru/post/898938/


All Articles