Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for host only, without Android SDK installed #128

Open
jamesrgrinter opened this issue Apr 15, 2019 · 1 comment
Open

Build for host only, without Android SDK installed #128

jamesrgrinter opened this issue Apr 15, 2019 · 1 comment

Comments

@jamesrgrinter
Copy link

I'd like to be able to build the JNI library for only the local host (compileNative_host), without having to have an Android SDK installed. I'm not interested in building Android archives or running this on Android.

It looks like this is meant to work. Naively running ./build-mac.sh, I got the error message:

...
gradle tasks --all

> Configure project :
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /usr/local/share/android-ndk.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

but after heeding that advice (I edited setenv.sh, and commented out every ANDROID_SDK variable) it still doesn't work:

gradle tasks --all

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/Users/jrg/Source/libsodium-jni/build.gradle' line: 233

* What went wrong:
A problem occurred evaluating root project 'libsodium-jni'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

and further attempts after removing more Android references from build.gradle make no progress. (Tried with both gradle 4.2 and gradle 5.3.1.)

I assume there are some build steps within the build.gradle that have come to rely upon something in the NDK?

@joshjdevl
Copy link
Owner

joshjdevl commented Apr 27, 2019

Running all tasks will have an Android dependency. build.gradle in this repository is meant for use in conjunction with Android.

compileNative_host was removed as the host compilation is managed upstream by the libsodium project.

The task generateSWIGsource might be what you are looking for. You can try executing those commands independently.

build.gradle has the android plugin at line 2 and android declarations.

You can try also looking at the various shell scripts that do not have gradle as a hard dependency.

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

No branches or pull requests

2 participants