Failed to create Android + Scala project using sbt + sbt-android plugin

I cannot create an Android + Scala project (and IntelliJ Idea 12) using the sbt and sbt-android plugin . I installed everything I needed and added ANDROID_SDK_HOME to both .bashrc and /etc/profile , but:

 me123@ubuntu:~/Documents/android_projects/my-android-project$ echo $ANDROID_SDK_HOME /home/me123/android-sdk-linux/sdk me123@ubuntu:~/Documents/android_projects/my-android-project$ sudo echo $ANDROID_SDK_HOME /home/me123/android-sdk-linux/sdk me123@ubuntu:~/Documents/android_projects/my-android-project$ sbt [info] Loading global plugins from /home/me123/.sbt/plugins [info] Loading project definition from /home/me123/Documents/android_projects/my-android-project/project [info] Compiling 3 Scala sources to /home/me123/Documents/android_projects/my-android-project/project/target/scala-2.9.2/sbt-0.12/classes... [error] /home/me123/Documents/android_projects/my-android-project/project/target/scala-2.9.2/sbt-0.12/classes/AndroidEclipse$Transformer.class (Permission denied) [error] one error found [error] (compile:compile) Compilation failed Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q me123@ubuntu:~/Documents/android_projects/my-android-project$ sudo sbt [info] Loading project definition from /home/me123/Documents/android_projects/my-android-project/project [info] Updating {file:/home/me123/Documents/android_projects/my-android-project/project/}default-6ff5da... [info] Resolving org.scala-sbt#precompiled-2_10_0;0.12.2 ... [info] Done updating. [error] Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME [error] Use 'last' for the full log. Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q 

UPDATE

  > android:start-device [info] Wrote /home/alex/Documents/android_projects/my-android-project/target/scala-2.10/src_managed/main/scala/my/android/project/TR.scala [info] Compiling 2 Scala sources and 1 Java source to /home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes... [warn] there were 4 feature warnings; re-run with -feature for details [warn] one warning found ProGuard, version 4.6 ProGuard is released under the GNU General Public License. You therefore must ensure that programs that link to it (scala, ...) carry the GNU General Public License as well. Alternatively, you can apply for an exception with the author of ProGuard. Reading program directory [/home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes] [trace] Stack trace suppressed: run last main/android:proguard for the full output. [error] (main/android:proguard) java.io.IOException: Can't read [/home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes] (Can't process class [my/android/project/R$id.class] (Unsupported version number [51.0] for class format)) [error] Total time: 14 s, completed May 30, 2013 3:49:46 PM 
+1
android scala sbt
May 29 '13 at 12:54
source share
1 answer

At first, executing sudo echo $ANDROID_HOME will be exactly the same as echo $ANDROID_HOME , because before executing the command the variable will be replaced by your shell.

Then you most likely have a resolution problem. Try running this to make sure you have the correct ones:

 $ chmod -Rv 700 /home/me123/Documents/android_projects/my-android-project/ 
+1
May 29 '13 at 13:39
source share



All Articles