clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

Unable to compile a Hello World #127

Closed GildedHonour closed 9 years ago

GildedHonour commented 9 years ago

I can't compile a Hello World:

1)

$ vim ~/.lein/profiles.clj

{:user {:plugins [[lein-droid "0.4.0-alpha1"]]
   :android {:sdk-path "/Users/alex/android/android-sdk-macosx"}}}

2) project.cjl in the root folder of my project

(defproject clojure_test/clojure_test "0.0.1-SNAPSHOT"
  :description "FIXME: Android project description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :global-vars {*warn-on-reflection* true}

  :source-paths ["src/clojure" "src"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :plugins [[lein-droid "0.4.0-alpha1"]]

  :dependencies [[org.clojure-android/clojure "1.7.0-alpha6" :use-resources true]
                 [neko/neko "3.2.0"]]
  :profiles {:default [:dev]

             :dev
             [:android-common :android-user
              {:dependencies [[org.clojure-android/tools.nrepl "0.2.10"]]
               :target-path "target/debug"
               :android {:aot :all-with-unused
                         :rename-manifest-package "com.gildedhonour.android.test1.debug"
                         :manifest-options {:app-name "clojure_test - debug"}
                         :sdk-path "/Users/alex/android/android-sdk-macosx"}}]

3) And when I try to compile it, it says nothing is found, although my internet connection is ok:

$ lein droid doall
(Warning: profile :android-common not found.)
(Warning: profile :android-user not found.)
Generating manifest...
Generating R.java...

4) The same goes for the "sample" from this repository:

$ pwd
/Users/alex/Downloads/lein-droid-master/sample

$ lein droid doall
(Warning: profile :android-common not found.)
(Warning: profile :android-user not found.)
^Csilveranbook:sample alex$ lein droid build
(Warning: profile :android-common not found.)
(Warning: profile :android-user not found.)
alexander-yakushev commented 9 years ago

It's a warning, not an error. What's the actual error that stops the build process?

You should also change org.clojure-android/tools.nrepl dependency to org.clojure/tools.nrepl. There was a bug in the template, sorry for that.

You can read more about profiles here https://github.com/clojure-android/lein-droid/wiki/Profiles

GildedHonour commented 9 years ago

Now it's working.

alexander-yakushev commented 9 years ago

Duplicate #126.

GildedHonour commented 9 years ago

I have a java android app. I'll start converting it to clojure. Is there any way to compile java and clojure source files in one project?

alexander-yakushev commented 9 years ago

Yes, like any other Clojure project. You put your java files into src/java/ and add that path to :java-source-paths in project.clj.

GildedHonour commented 9 years ago

I mean, the main project is in java, not in clojure.

alexander-yakushev commented 9 years ago

Can you ask you question on IRC or mailing list, and describe your setup thoroughly? Github isn't really suited for this.