clojure-android

jouerose 2017-04-28T08:39:34.487260Z

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

zakwilson 2017-04-28T13:43:11.616089Z

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

jouerose 2017-04-28T14:24:29.521208Z

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

zakwilson 2017-04-28T14:25:42.549244Z

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

jouerose 2017-04-28T14:59:19.343396Z

@zakwilson basically I did not even manage to finish compilation

jouerose 2017-04-28T15:03:55.461346Z

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

jouerose 2017-04-28T15:15:14.730528Z

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

jouerose 2017-04-28T15:15:18.732316Z

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

jouerose 2017-04-28T15:19:02.821411Z

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

zakwilson 2017-04-28T15:44:57.425832Z

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

jouerose 2017-04-28T15:49:32.530944Z

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

zakwilson 2017-04-28T15:51:16.571525Z

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

zakwilson 2017-04-28T15:52:56.609792Z

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

zakwilson 2017-04-28T15:56:08.684597Z

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

jouerose 2017-04-28T15:59:42.767838Z

thanks @zakwilson

zakwilson 2017-04-28T16:00:02.776176Z

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

jouerose 2017-04-28T16:25:21.323678Z

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

jouerose 2017-04-28T16:25:42.330751Z

:target-sdk "25"

jouerose 2017-04-28T16:25:59.337067Z

it no longer gets to the DEX creation

jouerose 2017-04-28T16:26:34.348541Z

this is where it stops:

jouerose 2017-04-28T16:26:35.348893Z

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)

zakwilson 2017-04-28T16:27:21.364951Z

Try lein clean first

jouerose 2017-04-28T16:30:18.427366Z

ok

jouerose 2017-04-28T16:33:40.498487Z

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

jouerose 2017-04-28T16:33:46.500432Z

it goes up to here:

jouerose 2017-04-28T16:33:47.500733Z

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)

jouerose 2017-04-28T16:33:55.503566Z

and more lines ....

jouerose 2017-04-28T16:36:38.557769Z

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

jouerose 2017-04-28T16:37:07.567768Z

@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

zakwilson 2017-04-28T16:38:00.584958Z

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

jouerose 2017-04-28T16:40:44.639256Z

actually I have no addition

jouerose 2017-04-28T16:41:02.645542Z

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

jouerose 2017-04-28T16:41:20.651707Z

this one: https://github.com/clojure-android/lein-droid

zakwilson 2017-04-28T16:42:07.666993Z

So lein new droid ...?

jouerose 2017-04-28T16:42:15.669662Z

yes

zakwilson 2017-04-28T16:43:30.694901Z

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.

jouerose 2017-04-28T16:45:08.728314Z

i am sorry it was :target-version all along

jouerose 2017-04-28T16:45:15.730788Z

22 ? ok i will try this

jouerose 2017-04-28T16:46:05.748437Z

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

zakwilson 2017-04-28T16:48:34.799474Z

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

jouerose 2017-04-28T16:55:37.943507Z

@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

jouerose 2017-04-28T17:03:41.115364Z

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

jouerose 2017-04-28T17:03:42.115640Z

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.

zakwilson 2017-04-28T18:42:32.191678Z

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

zakwilson 2017-04-28T18:42:52.198276Z

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

zakwilson 2017-04-28T18:43:49.216686Z

What do you get from lein version

jouerose 2017-04-28T18:49:43.342558Z

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

jouerose 2017-04-28T18:51:00.370692Z

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

jouerose 2017-04-28T18:51:31.381120Z

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