Hey guys,
so Im trying to get jenkins to build my android ndk app on my workstation im using android studio 1.5 with gradle 2.10 and the android ‘com.android.tools.build:gradle-experimental:0.6.0-alpha5’ and everything builds fine. On my jenkins server though I get this exception. `
A problem occurred configuring project : app
Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#createNativeLibrary
Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#createNativeLibrary > create(native-audio-jni)
java.lang.NullPointerException (no error message)`
It can be fixed by removing the module name (android.ndk) from the build file then everything builds just fine but I have a linkin error in android later on, so what am I missing here? does anybody have an idea?
build.gradle
`
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 23
buildToolsVersion = "23.0.0"
defaultConfig.with {
applicationId = "com.package.name"
minSdkVersion.apiLevel = 22
targetSdkVersion.apiLevel = 23
versionCode = 9
versionName = "1.0.1-alpha.8"
}
}
android.ndk {
moduleName = "native-audio-jni"
CFlags.add("-std=c99")
//CFlags.add("-DANDROID_NDK")
//CFlags.add("-DDISABLE_IMPORTGL")
//CFlags.add("-w")
//CFlags.add("-O3")
//CFlags.add("-fno-strict-aliasing")
//CFlags.add("-fprefetch-loop-arrays")
//CFlags.add("-DNULL=0")
//CFlags.add("-DSOCKLEN_T=socklen_t")
//CFlags.add("-DLOCALE_NOT_USED")
//CFlags.add("-D_LARGEFILE_SOURCE=1")
//CFlags.add("-D_FILE_OFFSET_BITS=64")
//CFlags.add("-Drestrict=''")
CFlags.add("-D__EMX__")
CFlags.add("-DOPUS_BUILD")
CFlags.add("-DFIXED_POINT")
CFlags.add("-DUSE_ALLOCA")
//CFlags.add("-DHAVE_LRINT")
//CFlags.add("-DHAVE_LRINTF")
//CFlags.add("-fno-math-errno")
//CFlags.add("-DAVOID_TABLES")
ldLibs.addAll(["android","OpenSLES", "log"])
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
}
}
android.lintOptions {
checkReleaseBuilds = false
abortOnError = false
}
android.productFlavors {
//create ("arm7") {
// ndk.abiFilters.add("armeabi-v7a")
//}
//create ("arm8") {
// ndk.abiFilters.add("arm64-v8a")
//}
//create ("x86-32") {
// ndk.abiFilters.add("x86")
//}
// for detailed abiFilter descriptions, refer to "Supported ABIs" @
// https://developer.android.com/ndk/guides/abis.html#sa
// build one including all productFlavors
// build one including all productFlavors
create("fat")
}
}
repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.splunk.mint:mint:4.4.0"
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:design:23.1.1'
}
`