我一直在尝试在我的 android 应用程序中将 GStreamer 从 1.14 升级到 1.16 版,但遇到了一些问题。根据 gstreamer 的网站,1.16 版需要 Android NDK r18b。当我尝试使用 NDK r18b 运行 GStreamer 1.16 时,我在 android studio 中遇到错误:
Expected ndk stl shared object file at /home/exjobb/Documents/android-ndk-r18-b-linux-x86_64/android-ndk-r18b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a /libgnustl_shared.so
cxx-stl 文件夹不在我的电脑上,后面的文件夹/文件也不在。
我用谷歌搜索过,似乎一般建议是降级到 r17c。如果 GStreamer 1.16 需要 r18b,我不能这样做。
这里可能是什么问题?
编辑:
我有两个不同的 build.gradle 文件。
这是第一个:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "se.liu.mrleo"
minSdkVersion 23
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
def gstRoot
if (project.hasProperty('gstAndroidRoot'))
gstRoot = project.gstAndroidRoot
else
gstRoot = System.env.GSTREAMER_ROOT_ANDROID
if (gstRoot == null)
throw new FileNotFoundException('GSTREAMER_ROOT_ANDROID not set')
arguments "NDK_APPLICATION_MK=jni/Application.mk",
"GSTREAMER_JAVA_SRC_DIR=src",
"GSTREAMER_ROOT_ANDROID=$gstRoot",
"GSTREAMER_ASSETS_DIR=src/main/assets"
targets "gstmredge"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
//path 'jni/Application.mk'
}
}
buildToolsVersion = '28.0.3'
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
afterEvaluate {
if (project.hasProperty('compileDebugJavaWithJavac')) {
project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug'
}
if (project.hasProperty('compileReleaseJavaWithJavac')) {
project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api project(':rtplibrary')
// Edge
implementation 'com.obsez.android.lib.filechooser:filechooser:1.1.19'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
// ARCore
implementation 'de.javagl:obj:0.3.0'
implementation 'com.google.ar:core:1.9.0'
}
这是第二个;
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}