Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

path problems in windows #138

Open
roti opened this issue Sep 19, 2015 · 11 comments
Open

path problems in windows #138

roti opened this issue Sep 19, 2015 · 11 comments

Comments

@roti
Copy link

roti commented Sep 19, 2015

Android SDK is installed in C:\Program Files\Android\android-sdk. Running lein droid doall throws the windows path-nightmare error:

Compiling clojure.repl
Compiling clojure.tools.nrepl.middleware.interruptible-eval
Compiling neko.-utils
Compiling neko.doc
Compilation succeeded.
Creating DEX....
Abort execution.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
@alexander-yakushev
Copy link
Contributor

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:(.

@roti
Copy link
Author

roti commented Sep 20, 2015

I did that and it works.

@AngryGami
Copy link

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.

@alexander-yakushev
Copy link
Contributor

You should run lein with DEBUG environment variable set to 1, and see which exact command is being called.

@AngryGami
Copy link

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

@alexander-yakushev
Copy link
Contributor

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?

@AngryGami
Copy link

Nope :(

@alexander-yakushev
Copy link
Contributor

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"

@AngryGami
Copy link

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 :)

@AngryGami
Copy link

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.

@alexander-yakushev
Copy link
Contributor

That's good news:).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants