Hi,
I've created a new clojure android project using the following command:lein new droid my-droid my.droid
I've modified my-droid/project.clj
, just to indicate the android-sdk path and when I tried to build the project using: lein droid build
the following error occurs:error: package neko does not exist
In fact the compilation error arise when trying to java compile the SplashActivity.java
generated by thelein-droid
plugin.
Hereafter the SplashActivity.java
file:
package my.droid;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import neko.App;
import my.droid.R;
public class SplashActivity extends Activity {
private static boolean firstLaunch = true;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (firstLaunch) {
firstLaunch = false;
setupSplash();
App.loadAsynchronously("my.droid.MainActivity",
new Runnable() {
@Override
public void run() {
proceed();
}});
} else {
proceed();
}
}
public void setupSplash() {
setContentView(R.layout.splashscreen);
TextView appNameView = (TextView)findViewById(R.id.splash_app_name);
appNameView.setText(R.string.app_name);
Animation rotation = AnimationUtils.loadAnimation(this, R.anim.splash_rotation);
ImageView circleView = (ImageView)findViewById(R.id.splash_circles);
circleView.startAnimation(rotation);
}
public void proceed() {
startActivity(new Intent("my.droid.MAIN"));
finish();
}
}
The compilation error occurs at line 10 when trying to import neko.App
class. However neko
is included in project dependency.
Hereafter the project .clj
file:
(defproject my-droid/my-droid "0.1.0-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.3"]]
:dependencies [[org.clojure-android/clojure "1.7.0-r2"]
[neko/neko "4.0.0-alpha5"]]
:profiles {:default [:dev]
:dev
[:android-common :android-user
{:dependencies [[org.clojure/tools.nrepl "0.2.10"]]
:target-path "target/debug"
:android {:aot :all-with-unused
:rename-manifest-package "my.droid.debug"
:manifest-options {:app-name "my-droid (debug)"}}}]
:release
[:android-common
{:target-path "target/release"
:android
{;; :keystore-path "/home/user/.android/private.keystore"
;; :key-alias "mykeyalias"
;; :sigalg "MD5withRSA"
:ignore-log-priority [:debug :verbose]
:aot :all
:build-type :release}}]}
:android {;; Specify the path to the Android SDK directory.
:sdk-path "D:/Users/Frederic/Tools/android-sdk"
;; Try increasing this value if dexer fails with
;; OutOfMemoryException. Set the value according to your
;; available RAM.
:dex-opts ["-JXmx4096M" "--incremental"]
:target-version "15"
:aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"
"cider.nrepl" "cider-nrepl.plugin"
"cider.nrepl.middleware.util.java.parser"
#"cljs-tooling\..+"]})
I sure I doing something wrong but I didn't find any way to fix it.
I am using the following leiningen version:Leiningen 2.5.1 on Java 1.7.0_51 Java HotSpot(TM) 64-Bit Server VM
--
You received this message because you are subscribed to the Google Groups "clojure-android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-andro...@googlegroups.com.
To post to this group, send email to clojure...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojure-android.
For more options, visit https://groups.google.com/d/optout.
Hi Alex,
After some tests using lein droid
on Windows, I probably found the reason of the
compilation issue.
The neko.jar
can not be resolved because my .m2
directory (i.e. the directory containing artefacts downloaded by
leiningen) is located in a parent directory which name contains some characters
with accent.
When I try to do the same on an other account (which username doesn't contain
accented characters), the compilation completes without any error.