Android Studio ERROR: Executing External Native Build For NdkBuild When Trying To Run Gstreamer Tutorial
Answer :
- Download the entire gstreamer android studio tutorial directory (https://gitlab.freedesktop.org/gstreamer/gst-docs/)
2)Open Android Studio -> Open an existing Android Studio Project
- Open the entire android tutorial directory
examples/tutorials/androidas a project
4)Once the project is open change the view on the left side of the screen to Project
Right click near local.properties file -> New -> File
Create a new file called
gradle.propertiesIn the new
gradle.propertiesfile copy and paste the below code.
# gstAndroidRoot can be set to point to the unpacked GStreamer android top-level directory # containing each architecture in subdirectories, or else set the GSTREAMER_ROOT_ANDROID # environment variable to that location gstAndroidRoot=/gstreamer_android_binaries NOTE Change the gstAndroidRoot variable to your file path where you downloaded the gstreamer binaries and unzipped them. Gstreamer can be downloaded from here for Android (https://gstreamer.freedesktop.org/data/pkg/android/)
- Now we need to set up NDK directory. Make sure you download and have NDK enabled under SDK tools.
9)This will download the latest NDK version. However gstreamer currently will not build with the latest NDK. We need to download NDK Revision 18b (https://developer.android.com/ndk/downloads/older_releases) If you do not use NDK version 18 you will likely get an error Android NDK: Assertion failure: SYSROOT_LINK is not defined . Stop. Open File
Unzip the downloaded NDK 18b directory.
Take the unzipped
android-ndk-r18bdirectory and move it to where the ndk folder is underAppData\Local\Android\Sdk\ndkYou should now have two folders within
Android\Sdk\ndk.20.0.5594570 (or latest version)andandroid-ndk-r18bIn android studio go to File -> project Structure
Under Android NDK location point to the NDK 18 directory. Example:
C:\Users\AppData\Local\Android\Sdk\ndk\android-ndk-r18bConnect a phone with USB debugging and run!
If you get an error on the phone stating it is for an older version of android. Go back to Android Studio and switch to
Android Viewon the left side of the screen. UnderGradle Scriptsselect thebuild.gradlefor the appropriate tutorial. Change thecompileSdkVersion 29,minSDKVersion 15, andtargetSDKVersion 29.
Comments
Post a Comment