Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Seabolt

Member Since 26 May 2010
Online Last Active Today, 10:20 AM
-----

Posts I've Made

In Topic: Javah problems with class that extends Activity

09 April 2013 - 06:05 PM

Since no one is responding, I'll try a different question; is javah really necessary? It seems like I should be able to resolve the name mangling myself. And I never had to run it on hello-jni, though I imagine it's only because the name mangling isn't an issue in C.

Has anyone done any C++ development in Android using JNI?


In Topic: Android Hello-JNI Build Help

07 April 2013 - 03:39 PM

Okay, so after playing around with the Path variable, I got it to work again. It's really strange stuff though. For a bit I could only compile through clicking the ndk-build.cmd, if I ran it from the command line, it would compile Hello-jni. 

Anyways I have it compiling again, now I just have to solve my issues with linking. Thanks guys!


In Topic: Android Hello-JNI Build Help

07 April 2013 - 11:48 AM

Alright, one quick follow up, just to make sure I have this right: I got hello-jni to compile by running the ndk-build.cmd file that was in my NDK directory. Now I've made my own project that was essentially the same as Hello-Jni but with new file names and such, just to see if I could reliably build a program and work on it. I could not. 

When I tried to run the ndk-build again, it just re-compiled hello-jni. I changed my NDK_PROJECT_PATH in my computer's environment variables, but now I'm seeing there are tons of places where these environment variables can be set, where do I find them all?

Also I tried to provide a directory to the build script, and it would cd to my directory and then just compile hello-jni anyways.

I moved a copy of ndk-build to my projects jni directory. I tried running it from bash like so:

cd to my project root.
$ ./ndk-build

Then I get the output: 



./ndk-build: line 40: dirname: command not found
./ndk-build: line 132: uname: command not found
ERROR: Unknown host operating system:

Any idea what could cause this? Also if I cd to the jni directory and run the file from there, I get a "cannot find file specified" error and the build never happens.

How do you run your ndk-build file? Where is it located? What environment variables do you have setup, and where?

Sorry for the long question, but everytime I think I have something figured out, I get lost again.

In Topic: Android Hello-JNI Build Help

06 April 2013 - 06:43 PM

So I had to re-install the entire Android SDK and NDK. But I got it working now finally.
Thanks for your help guys!

I'm sure I'll be bothering you plenty as my project goes on.


In Topic: Android Hello-JNI Build Help

04 April 2013 - 12:28 PM

Haha, it's no problem I appreciate any tidbits of information!

The process thing is very weird. It's almost like it's launching the compiler twice for some reason. 


PARTNERS