Fork me on GitHub
#clojure-android
<
2017-04-28
>
jouerose08:04:34

@zakwilson thanks. is clojure on android stopped as a project ?

zakwilson13:04:11

@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.

jouerose14:04:29

@zakwilson i see. I was personally quite interested in using it but the idleness has been a brake. I wish it was active

zakwilson14:04:42

@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.

jouerose14:04:19

@zakwilson basically I did not even manage to finish compilation

jouerose15:04:55

@zakwilson i am going to try to quickly go through the steps again and let you know where exactly i got stuck

jouerose15:04:14

@zakwilson "lein droid doall" went fine until this:

jouerose15:04:18

Creating DEX.... PARSE ERROR: unsupported class file version 52.0 ...while parsing android/annotation/SuppressLint.class 1 error; aborting

jouerose15:04:02

@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 ?)

zakwilson15:04:57

@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.

jouerose15:04:32

@zakwilson oh ok. does this mean it is not really at compilation (javac ?) that the problems occurs but more at execution ?

zakwilson15:04:16

@jouerose javac on my machine is /usr/lib/jvm/java-7-openjdk-amd64/bin/javac

zakwilson15:04:56

But you can have DEBUG=1 and see the shell commands lein runs so as to make sure you're using the right paths

zakwilson15:04:08

Alternately :java-cmd in project.clj or profiles.clj should do it

zakwilson16:04:02

No problem. Let me know if it works. I want Clojure on Android to become a viable thing.

jouerose16:04:21

@zakwilson I have set :java-cmd "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java"

jouerose16:04:42

:target-sdk "25"

jouerose16:04:59

it no longer gets to the DEX creation

jouerose16:04:34

this is where it stops:

jouerose16:04:35

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)

zakwilson16:04:21

Try lein clean first

jouerose16:04:40

after lein clean, then lein droid doall, knowing :target-sdk 25 and :java-cmd as above said.

jouerose16:04:46

it goes up to here:

jouerose16:04:47

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)

jouerose16:04:55

and more lines ....

jouerose16:04:38

@zakwilson when I set :target-sdk 23 , it succeeds in compilation and stops at CREating DEX.

jouerose16:04:07

@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

zakwilson16:04:00

Do you mind sharing the source for this? Is it on github?

jouerose16:04:44

actually I have no addition

jouerose16:04:02

I am just trying to compile the base lein-droid project

zakwilson16:04:07

So lein new droid ...?

zakwilson16:04:30

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.

jouerose16:04:08

i am sorry it was :target-version all along

jouerose16:04:15

22 ? ok i will try this

jouerose16:04:05

I must install sdk platform 22 first it says. going to do that now

zakwilson16:04:34

I haven't tried another version recently. I'll do so later.

jouerose16:04:37

@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

jouerose17:04:41

@zakwilson , with version 22, it stops the same:

jouerose17:04:42

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.

zakwilson18:04:32

@jouerose 52 definitely means it was compiled with JDK 8.

zakwilson18:04:52

So some part of your build process is using the wrong Java version.

zakwilson18:04:49

What do you get from lein version

jouerose18:04:43

@zakwilson Leiningen 2.7.1 on Java 1.7.0_80 Java HotSpot(TM) 64-Bit Server VM

jouerose18:04:00

@could it not be some dependency that my personal build does not compile ?

jouerose18:04:31

if you use JDK 8, could you please try to go through the "lein new droid..." to see ?