2016-07-31 99 views
-1

我想將GStreamer包含到我的jni文件夾中。但所有的依賴都被打破了。例如Android NDK損壞包括

#include <glib.h> 

應與

#include <../../../include/glib-2.0/glib.h> 

代替我使用gradle這個實驗性0.7.2

我的應用程序的build.gradle:

apply plugin: 'com.android.model.application' 

model { 

android { 
    compileSdkVersion = 24 
    buildToolsVersion = "24.0.1" 

    defaultConfig.with { 
     applicationId = "com.sizyntsev.cpplearning" 
     minSdkVersion.apiLevel = 16 
     targetSdkVersion.apiLevel = 23 
    } 

} 

android.buildTypes { 
    release { 
     minifyEnabled = false 
     proguardFiles.add(file("proguard-rules.pro")) 
    } 
} 

android.ndk{ 
    moduleName "gstreamer" 
    cppFlags.add("-I ${new File("src/main/jni/gstreamer_lib/include/glib-2.0/glib.h").absolutePath}".toString()) 
} 

} 

dependencies { 
    compile 'com.android.support:appcompat-v7:24.1.0' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
} 

回答

0
cppFlags.add("-I ${new File("src/main/jni/gstreamer_lib/include/glib-2.0/glib.h").absolutePath}".toString()) 

你應該傳遞路徑到目錄,而不是路徑文件本身。你也可以檢查生成的中間Android.mk。只要看看build/intermediates/ndk