@zakwilson thanks. is clojure on android stopped as a project ?
@jouerose I don't think stopped... more like idle. I've been using it in an open source app though and I might be inclined to fork it if we don't see an increase in activity.
@zakwilson i see. I was personally quite interested in using it but the idleness has been a brake. I wish it was active
@jouerose is there something specific you need it to do that it doesn't, or a question you're not getting answered? I quite like it versus the alternatives I'm aware of for Android dev, so I plan to stick with it.
@zakwilson basically I did not even manage to finish compilation
@zakwilson i am going to try to quickly go through the steps again and let you know where exactly i got stuck
@zakwilson "lein droid doall" went fine until this:
Creating DEX.... PARSE ERROR: unsupported class file version 52.0 ...while parsing android/annotation/SuppressLint.class 1 error; aborting
@zakwilson i am searching on the web and it seems the problem is related to having jdk 1.8 while compilation needs 1.7 so now i am looking for how to instruct that to the (lein-droid plugin ?)
@jouerose I linked /usr/bin/java to 1.7 on my machine, but you could set the LEIN_JAVA_COMMAND environment variable. There may be another officially supported method.
@zakwilson oh ok. does this mean it is not really at compilation (javac ?) that the problems occurs but more at execution ?
@jouerose javac on my machine is /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
But you can have DEBUG=1 and see the shell commands lein runs so as to make sure you're using the right paths
Alternately :java-cmd in project.clj or profiles.clj should do it
thanks @zakwilson
No problem. Let me know if it works. I want Clojure on Android to become a viable thing.
@zakwilson I have set :java-cmd "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java"
:target-sdk "25"
it no longer gets to the DEX creation
this is where it stops:
Compiling neko.log Exception in thread "main" java.lang.UnsupportedClassVersionError: android/util/Log : Unsupported major.minor version 52.0, compiling:(/private/var/folders/s1/9mbhh1tn4nq7n99k_x15x4pw0000gn/T/form-init3372536726000576931.clj:1:125)
Try lein clean first
ok
after lein clean, then lein droid doall, knowing :target-sdk 25 and :java-cmd as above said.
it goes up to here:
Running javac with [-target 1.6 -source 1.6 -Xlint:-options @/var/folders/s1/9mbhh1tn4nq7n99k_x15x4pw0000gn/T/.leiningen-cmdline1725830604360410394.tmp] Compiling clojure.zip Compiling neko.log Exception in thread "main" java.lang.UnsupportedClassVersionError: android/util/Log : Unsupported major.minor version 52.0, compiling:(log.clj:1:1) at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3638)
and more lines ....
@zakwilson when I set :target-sdk 23 , it succeeds in compilation and stops at CREating DEX.
@zakwilson Compilation succeeded. Creating DEX.... /Users/paulsika/Library/Android/sdk/build-tools/25.0.2/dx -JXmx4096M --incremental --dex --no-optimize --output /Users/paulsika/Projects/droidapp/target/debug /Users/paulsika/Projects/droidapp/target/debug/classes /Users/paulsika/.m2/repository/org/clojure-android/clojure/1.7.0-r4/clojure-1.7.0-r4.jar /Users/paulsika/.m2/repository/neko/neko/4.0.0-alpha5/neko-4.0.0-alpha5.jar /Users/paulsika/.m2/repository/org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar /Users/paulsika/Projects/droidapp/target/debug/aar-extracted/com.android.support_multidex_aar_1.0.0/classes.jar /Users/paulsika/Library/Android/sdk/tools/support/annotations.jar PARSE ERROR: unsupported class file version 52.0 ...while parsing android/annotation/SuppressLint.class 1 error; aborting
Do you mind sharing the source for this? Is it on github?
actually I have no addition
I am just trying to compile the base lein-droid project
So lein new droid ...
?
yes
I don't have :target-sdk
set, but I do have target-version
set to 22. Give that a try first. Do remember to lein clean
each time you change project.clj.
i am sorry it was :target-version all along
22 ? ok i will try this
I must install sdk platform 22 first it says. going to do that now
I haven't tried another version recently. I'll do so later.
@zakwilson you trying another version would be very helpful as there seems to be some updating to do to the plugin. will let you know about trying version 22
@zakwilson , with version 22, it stops the same:
Creating DEX.... /Users/paulsika/Library/Android/sdk/build-tools/25.0.2/dx -JXmx4096M --incremental --dex --no-optimize --output /Users/paulsika/Projects/droidapp/target/debug /Users/paulsika/Projects/droidapp/target/debug/classes /Users/paulsika/.m2/repository/org/clojure-android/clojure/1.7.0-r4/clojure-1.7.0-r4.jar /Users/paulsika/.m2/repository/neko/neko/4.0.0-alpha5/neko-4.0.0-alpha5.jar /Users/paulsika/.m2/repository/org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar /Users/paulsika/Projects/droidapp/target/debug/aar-extracted/com.android.support_multidex_aar_1.0.0/classes.jar /Users/paulsika/Library/Android/sdk/tools/support/annotations.jar PARSE ERROR: unsupported class file version 52.0 ...while parsing android/annotation/SuppressLint.class 1 error; aborting Abort execution.
@jouerose 52 definitely means it was compiled with JDK 8.
So some part of your build process is using the wrong Java version.
What do you get from lein version
@zakwilson Leiningen 2.7.1 on Java 1.7.0_80 Java HotSpot(TM) 64-Bit Server VM
@could it not be some dependency that my personal build does not compile ?
if you use JDK 8, could you please try to go through the "lein new droid..." to see ?