Correct setup of Android NDK

liortal53liortal53
edited June 2013 in Native
Hello,

We'd like to use the Photon SDK for Android (using the NDK).

The SDK you provide comes with the sources and precompiled outputs.

1. Can i use the precompiled outputs as-is out of the box? (without building anything?)
2. Must i use WinGDB or can i build the samples + libraries myself in some other way?
3. What is the easiest way to build a sample (let's say - the LoadBalancing sample):

I have the NDK properly installed, however the compilation using the Android.mk file that is provided for this sample fails, here's the output:

process_begin: CreateProcess(NULL, pwd, ...) failed.
Android NDK: WARNING: Ignoring unknown import directory: /../../../../LoadBalancing-cpp/android
process_begin: CreateProcess(NULL, pwd, ...) failed.
Android NDK: WARNING: Ignoring unknown import directory: /../../../../LoadBalancing-cpp
Android NDK: jni/Android.mk: Cannot find module with tag 'loadbalancing-cpp-prebuilt' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
jni/Android.mk:34: *** Android NDK: Aborting. . Stop.

Comments

  • 1. Yes.
    2. You can also just run the makefiles to build the demos. You don't have to build the libs. You can rebuild the LB lib, if you want to modify its code, but you don't have to.
    3. Either just open and run the WinGDB project and click on run in VS or just use the standard android ndk makefile approach: the makesfiles are located in demofolder/android/jni.

    About your failed demo-build:
    Which SDK version are you using?
  • Unfortunately i couldn't get the makefiles to work for me (and for another developer on my team).
  • I assume that you try on Windows.

    1. navigate to pathToYourCygwinInstallation/bin and start bash.exe
    2. in the cygwin bash console window input "cd /cygdrive/driveletter/pathIntoWhichYouHaveUnzippedTheAndroidClientSDK/Demos/demo_loadBalancing/android/jni" (without the "") and press enter.
    3. now enter "ndk-build NDK_APPLICATION_MK=debug_android_armeabi.mk" and press enter again.

    That should successfully create "cd /cygdrive/driveletter/pathIntoWhichYouHaveUnzippedTheAndroidClientSDK/Demos/demo_loadBalancing/android/libs/armeabi/libdemoLoadBalancing.so"

    Other valid options than debug_android_armeabi.mk for NDK_APPLICATION_MK are debug_android_armeabi-v7a.mk, release_android_armeabi.mk and release_android_armeabi-v7a.mk.

    From your output I guess that you have used the windows standard cmd.exe instead of the cygwin bash.exe.
    For Android NDK makefiles you should always use the cygwin bash.exe (that''s nothing Photon specific).
  • I did exactly as your described (in Cygwin).

    Still getting an error when building:

    ../../../../Common-cpp/inc/JVector.h:12:8: fatal error: memory: No such file or directory
  • Please set "APP_STL" in your applications Application.mk file to stlport_static, stlport_shared, gnustl_static or gnustl_shared.
  • I have done this.

    I was trying to use the sample first (under Demos). When using it, there is no Application.mk (this is not my application).

    If this is required to build the sample, i believe it should be there when downloading it from your site (unless of course the error on my side happens due to misconfigured environment or something similar).
  • Telling from your new thread I guess, that you have solved this issue?
Sign In or Register to comment.