1

I found a nice example with OpenGL for Android NDK. Then I tried to use it on Android Studio through the option import project. So, this is how the project files are distributed:

enter image description here

Then when I try to run it, it gives the message:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Task '' not found in root project 'ndk3D'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I went into: Run > Edit Configurations > Defaults > Android application > Additional command line options, and added: --stacktrace --info . On the same window, selected: Gradle > VM Options, and added: --stacktrace --info . Pressed: Apply OK. Then: Build > Make Project. The error message remains the same.

I couldn't also find a component tag, should the problem be related to API version, so downgrading my API would solve it?

I also tried to import it into Eclipse and it didn't work either.

Any suggestion what might be missing? All comments are welcome.

Community
  • 1
  • 1
Linda Lowela
  • 393
  • 1
  • 3
  • 10
  • 1
    The Android Studio page (http://developer.android.com/sdk/installing/studio.html) says "Coming Soon" for NDK support. So it doesn't look like it's supported yet. – Reto Koradi Nov 09 '14 at 23:59

1 Answers1

0

I'm absolute novice at using Android Studio but as an exercise to learn a bit of Gradle I did a simple port of android-native-egl-example from Ant to Gradle. You can browse the project at https://github.com/tsaarni/android-native-egl-example/tree/gradle and compare to the master branch to see the changes.

To try it out, first go to console and navigate to AndroidStudioProjects directory and run git clone -b gradle git@github.com:tsaarni/android-native-egl-example.git. Then launch Android Studio, choose "Open an existing Android Studio project" and select the newly cloned directory. Set your SDK and NDK paths to local.properties file.

tsaarni
  • 818
  • 1
  • 8
  • 18