首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误:原因: org.gradle.api.internal.ExtensibleDynamicObject

错误:原因: org.gradle.api.internal.ExtensibleDynamicObject
EN

Stack Overflow用户
提问于 2016-06-22 12:58:57
回答 1查看 1.2K关注 0票数 0

我试图在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文件内容:

代码语言:javascript
运行
复制
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')
    }
}

}

EN

回答 1

Stack Overflow用户

发布于 2016-08-18 06:41:12

代码语言:javascript
运行
复制
minSdkVersion.apiLevel 16
targetSdkVersion.apiLevel 21

而不是

代码语言:javascript
运行
复制
minSdkVersion 16
targetSdkVersion 21

代码语言:javascript
运行
复制
moduleName = 'ndktest'

而不是

代码语言:javascript
运行
复制
moduleName "ndktest"

它应该是

代码语言:javascript
运行
复制
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')
            }
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37968781

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档