lucasweb lucasweb - 6 months ago 151
Android Question

Unable to build GStreamer for Android Tutoritals

I'm running into a number of issues attempting to build the GStreamer Android tutorials.

My environment is:

  • Mac OS X 7

  • Android SDK version 17

  • Android NDK 8d

I am able to build and run the NDK samples both in Eclipse and from the command line.

I have downloaded and added the GSTREAMER_SDK_ROOT_ANDROID environment variable to my .bash_profile.

When I try to build android-tutorial-1 via Eclipse I get the following error:

12:12:05 **** Incremental Build of configuration Default for project Tutorial1 ****
/apps/tools/android-ndk-r8d/ndk-build all
jni/ *** GSTREAMER_SDK_ROOT_ANDROID is not defined!. Stop.

12:12:05 Build Finished (took 104ms)

I have tried adding GSTREAMER_SDK_ROOT_ANDROID to the C++ build variables in Eclispe but it makes no difference.

When I try to build via the command line I get the following error:

/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
GStreamer : [GEN] => gst-build/gstreamer_android.c
GStreamer : [COMPILE] => gst-build/gstreamer_android.c
gst-build/gstreamer_android.c:2:21: fatal error: gst/gst.h: No such file or directory
compilation terminated.
make: *** [gst-build/gstreamer_android.o] Error 1

What I can't figure out is gst/gst.h can not be resolved?


I posted the above question on the GStreamer Android mailing list and got the following response:

Hi, Unfortunately we forgot to include pkg-config in this release for Mac OS X. You can download it from here:

I used homebrew to install pkg-config and was able to build all of the Android Tutorials via the command line using ndk-build.

I still have a number of issues in Eclipse:

  1. * GSTREAMER_SDK_ROOT_ANDROID is not defined! - I can not get Eclipse to pick up this variable
  2. If I hard code the variable into the make file I then get /bin/sh: pkg-config: command not found - pkg-config is installed and working via the CLI

I believe some of the issues are related to Android Issue 33788 and I have attempted to resolve them using CDT 8.0.2 instead of CDT 8.10 but it did not solve either of the above issues.

I have worked around the problem for now by doing the following:

  1. Disabled CDT building for my project
  2. Building the NDK code using the CLI ndk-build
  3. Building and deploying the application to my device via Eclipse as normal