• Create Account

# Android Hello-JNI Build Help

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

17 replies to this topic

### #1Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 03 April 2013 - 05:17 PM

Hey guys,

I've started development on Android, and currently it is handing me my butt.

Let me give you a little timeline so far and make sure that I haven't screwed anything up:

I applied to the nVidia Tegra3 Developers group which they approved me for.
I "installed" android NDK using their installer. It supposedly installs everything needed to develop android.

I do indeed have the Android SDK, NDK, Eclipse and Ant installed. A cursory look at my environment variables looks like the setup enough for me.

So then I bumble around Eclipse, (I've been a spoiled developer too long working in VS), and import the hello-jni project.

I run the build, it says I'm missing an environment variable for my project. Easy enough, setup an env var called NDK_PROJECT_PATH going to the root directory for the project.

I run the build again, and I get a bunch of warnings and the make command fails.
Here are the warnings I get:

C:\NVPACK\android-ndk-r8d>ndk-build
C:/NVPACK/android-ndk-r8d/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-8 is larger than android:minSdkVersion 3 in C:\NVPACK\android-ndk-r8d\samples\hello-jni/AndroidManifest.xml
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:150: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:439: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'
The process cannot access the file because it is being used by another process.
Gdbserver      : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
The system cannot find the path specified.
make: *** [C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi/gdbserver] Error 1
Press any key to continue . . .


Now I'm looking for some general help on what seems to be a very newby question:

How can I get Hello World to compile?

I see that it can't find a path specified. But I have no idea what path they're talking about. Also I see an error regarding accessing a file that's in use, but I don't have much of anything running.

I'm working on a Windows 7 machine, and while I'm an experienced programmer, this is my first time venturing outside of Visual Studios at all, so please don't assume much knowledge from me

Thanks!

Perception is when one imagination clashes with another

### #2Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 03 April 2013 - 05:28 PM

Android NDK: WARNING: APP_PLATFORM android-8 is larger than android:minSdkVersion 3

With compilers I usually start from the top of the errors. Looks like your SDK doesn't support that version of android.

The process cannot access the file because it is being used by another process.

Perhaps you tried once and the process never closed?

### #3Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 03 April 2013 - 05:38 PM

Hm. How would I address those issues if you don't mind me asking? Should I re-install the SDK, or is this a project property? And if it's the latter how would I change that? And that is a possibility, though I don't see any obvious offenders in the task manager. Are there any exe's that I should be looking for?

Again sorry for all the (most likely stupid) questions, I'm just not entirely sure what I should be looking for and don't want to overlook anything.

Perception is when one imagination clashes with another

### #4Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 03 April 2013 - 06:03 PM

Well, I'm not sure what process is using your file, however a simple computer reboot will unload whatever is in use. If you still get the file in use error, then you will have to actually track down what has it open.

You got your files off of the nVidia Tegra3 developer site?

### #5Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 03 April 2013 - 06:18 PM

Yeah, they have some sort of Android install package. It looked really appealing to begin with!

I'll do some searching for addressing the SDK warning.

Perception is when one imagination clashes with another

### #6Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 03 April 2013 - 06:24 PM

Well, if all else fails, use Google's installation. Since you do not use Eclipse otherwise, they have an Eclipse install that comes with a few things setup. Give that a try.

### #7Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 03 April 2013 - 06:25 PM

Yeah I might have to do that.

Sigh, I've spent almost 15 hours just trying to get Hello World running!

Thanks for the help. I imagine I'll be back soon.

Perception is when one imagination clashes with another

### #8Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 03 April 2013 - 06:47 PM

I'm reinstalling my installation and giving it a whirl.

### #9Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 03 April 2013 - 07:02 PM

Going back through the installation process, I found this:

The NDK is compatible with older platform versions but not older versions of the SDK tools.

Could this be your issue?

### #10Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 03 April 2013 - 11:49 PM

Hmm maybe. I thought that just meant it wasn't compatible pre-froyo. But I may just need to install the NDK from google and write over what nVidia installed.

Perception is when one imagination clashes with another

### #11Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 04 April 2013 - 12:17 AM

It's possible that it means it is not compatible. You still have the problem with the file being in use. Did you try just restarting?

### #12Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 04 April 2013 - 08:14 AM

Yeah I tried running it after a fresh restart and got the same issue.

*Psst, Google, some helpful messaging would be great *

Perception is when one imagination clashes with another

### #13Cornstalks  Crossbones+   -  Reputation: 6995

Like
1Likes
Like

Posted 04 April 2013 - 08:27 AM

I'm going to go over these from the start...

C:\NVPACK\android-ndk-r8d>ndk-build
C:/NVPACK/android-ndk-r8d/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-8 is larger than android:minSdkVersion 3 in C:\NVPACK\android-ndk-r8d\samples\hello-jni/AndroidManifest.xml

If you open AndroidManifest.xml, you'll see that it says minSdkVersion is 3. That's a problem, because the NDK requires a min SDK of version 8. Basically, your manifest file is saying "I support Android API level 3!" (which is Android 1.5), but that's a lie, and it's warning you about it, because your makefiles are (correctly) saying that it requires at least API level 8 (version 2.2). Just change minSdkVersion in AndroidManifest.xml to be 8.

C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:150: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:439: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/setup-toolchain.mk:167: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'
C:/NVPACK/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old commands for target C:\NVPACK\android-ndk-r8d\samples\hello-jni/obj/local/armeabi'

These all look like they're the same error, but I'm not 100% sure I understand it. Try fixing the first warning and dealing with these later.

The process cannot access the file because it is being used by another process.
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
The system cannot find the path specified.
make: *** [C:\NVPACK\android-ndk-r8d\samples\hello-jni/libs/armeabi/gdbserver] Error 1
Press any key to continue . . .

This one looks goofy because it's saying it can't find the gdbserver (the server for the GDB debugger, used to remotely debug native Android code).

I've never had problems like this when I've developed native stuff for Android, but then again, I've always worked on OS X and I've never used any nVidia stuff (just straight Android SDK + NDK). Sorry I'm not much more help.
[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

### #14Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 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.

Perception is when one imagination clashes with another

### #15Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 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.

Perception is when one imagination clashes with another

### #16Dragonsoulj  Crossbones+   -  Reputation: 2113

Like
1Likes
Like

Posted 06 April 2013 - 08:14 PM

Glad you got it fixed. I'm getting my Android stuff reinstalled and running so I hope I can help you more. Easier to test when you have the development environment.

### #17Seabolt  Members   -  Reputation: 633

Like
0Likes
Like

Posted 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.

Perception is when one imagination clashes with another

### #18Seabolt  Members   -  Reputation: 633

Like
1Likes
Like

Posted 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!

Perception is when one imagination clashes with another

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS