Sample native-audio in NDK build issue

I had a problem creating an example of native-audio in NDK. Main reason: "SLES / OpenSLES.h: no such file or directory"

I have googled, but I find nothing useful.

Please help me.

Thanks in advance

+8
android android-ndk
source share
5 answers

If you are building from the command line, try

ndk-build TARGET_PLATFORM = android-9

+11
source share

this is related to your version of android. specify the android version when building.

ndk-build TARGET_PLATFORM = android-9

+6
source share

I also have this problem, but now it works. You must use the Android 9 API. In Eclipse, create a new project from an existing source (native-audio sample) that targets Android 2.3.1, and then create a shared library using ndk-build. Finally, create your project in Ecclipse in the usual way. Hope this helps you.

+3
source share

If you are using Android Studio and Application.mk . Install the Android platform version using:

 //replace 'x' with the platform version you are targeting APP_PLATFORM := android-x 

Click here for the ndk-r10c link. I am using ndk-r10e and still use the same variable.

+3
source share

in Android Studio, you can solve this problem by adding the following line to the project.properties file:

 target=android-23 // replace 23 with the api you are targeting 

The project.properties file should be inside the main directory, if it does not exist, you can create the file and it should work fine.

0
source share

All Articles