Open roti opened 8 years ago
The last time I've looked into this issue it was much easier just to move the android SDK into some other place without spaces:(.
I did that and it works.
I somewhat similar problem
Creating DEX....
unknown output extension: C:\Users\Me\projects\myproject\target\debug
usage:
dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals]
My paths either to project or android sdk are without spaces. So solution above didn't worked.
You should run lein with DEBUG
environment variable set to 1, and see which exact command is being called.
Don't know what is actually wrong here:
cmd.exe /C C:\Users\me\programs\androidsdk\sdk\build-tools\android-4.2.2\dx.bat -JXmx4096M --incremental --dex --no-optimize --output C:\Users\me\projects\myproj\target\debug C:\Users\me\projects\myproj\target\debug\classes C:\Users\me\.m2\repository\neko\neko\4.0.0-alpha5\neko-4.0.0-alpha5.jar C:\Users\me\.m2\repository\org\clojure\tools.nrepl\0.2.10\tools.nrepl-0.2.10.jar C:\Users\me\.m2\repository\org\clojure-android\clojure\1.7.0-r2\clojure-1.7.0-r2.jar C:\Users\me\projects\myproj\target\debug\aar-extracted\com.android.support_multidex_aar_1.0.0\classes.jar C:\Users\me\programs\androidsdk\sdk\tools\support\annotations.jar
Try running this command manually from the shell, but add a slash to the end of the --output
, so it becomes:
cmd.exe /C C:\Users\me\programs\androidsdk\sdk\build-tools\android-4.2.2\dx.bat -JXmx4096M --incremental --dex --no-optimize --output C:\Users\me\projects\myproj\target\debug\ C:\Users\me\projects\myproj\target\debug\classes C:\Users\me\.m2\repository\neko\neko\4.0.0-alpha5\neko-4.0.0-alpha5.jar C:\Users\me\.m2\repository\org\clojure\tools.nrepl\0.2.10\tools.nrepl-0.2.10.jar C:\Users\me\.m2\repository\org\clojure-android\clojure\1.7.0-r2\clojure-1.7.0-r2.jar C:\Users\me\projects\myproj\target\debug\aar-extracted\com.android.support_multidex_aar_1.0.0\classes.jar C:\Users\me\programs\androidsdk\sdk\tools\support\annotations.jar
Will that work?
Nope :(
The problem is, dx on Windows wants to treat the --output
path as a file, when it is a path. I don't really know why. Another thing you can do is to put :out-dex-path
to your :android
map in project.clj
, and set it to target\debug\classes.dex
.
(defproject ...
...
:android {...
:out-dex-path "target\debug\classes.dex"
This move me one step further :) It manages to do dexing but now complains that:
Creating APK...
No *.dex files found in C:\Users\Rodion\projects\smarthomeclj\target\debug\classes.dex
Probably because now lein-droid expect that "classes.dex" is a directory :)
Ha! I found what was happening. It was using tools for android-4.2.2 while proper tools version should be 21.1.2. Now it builds.
That's good news:).
Android SDK is installed in
C:\Program Files\Android\android-sdk
. Runninglein droid doall
throws the windows path-nightmare error: