我试图在Android中使用NDK,但是出现了一个错误:
org.gradle.api.internal.ExtensibleDynamicObject错误:原因:
我的Android版本是2.2预览1,而Gradle版本是2.10。
分级-实验版本为0.7.0
我试过这个Gradle build Error:Cause: org.gradle.api.internal.ExtensibleDynamicObject,但它不起作用。
有人知道怎么解决吗?
以下是我的build.gradle文件内容:
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "me.stupideme.shuclass"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
android.ndk {
moduleName "ndktest"
ldLibs.addAll(['log'])
cppFlags.add("-std=c++11")
cppFlags.add("-fexceptions")
platformVersion 16
stl 'gnustl_shared'
}
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles += file('proguard-rules.pro')
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'io.github.yavski:fab-speed-dial:1.0.1'
compile 'com.github.akashandroid90:imageletter:1.5'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
}
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
proguardFiles += file('proguard-rules.pro')
}
}}
发布于 2016-08-18 06:41:12
minSdkVersion.apiLevel 16
targetSdkVersion.apiLevel 21而不是
minSdkVersion 16
targetSdkVersion 21和
moduleName = 'ndktest'而不是
moduleName "ndktest"它应该是
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "me.stupideme.shuclass"
minSdkVersion.apiLevel 16
targetSdkVersion.apiLevel 21
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
android.ndk {
moduleName = 'ndktest'
ldLibs.addAll(['log'])
cppFlags.add("-std=c++11")
cppFlags.add("-fexceptions")
platformVersion 16
stl 'gnustl_shared'
}
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles += file('proguard-rules.pro')
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'io.github.yavski:fab-speed-dial:1.0.1'
compile 'com.github.akashandroid90:imageletter:1.5'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
}
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
proguardFiles += file('proguard-rules.pro')
}
}
}
}https://stackoverflow.com/questions/37968781
复制相似问题