构建apk ion ionic3项目时gradle构建错误

时间:2020-01-30 07:46:11

标签: gradle build ionic3

美好的一天,开发者请我在尝试从ionic3项目构建apk时不断收到错误消息

无法获取类型为com.android.build.gradle.LibraryExtension的对象的未知属性'cdvCompileSdkVersion'。

我的build.gradle在下面

FLOAT8

如果需要,我的package.json在下面提供了更多详细信息,我尝试删除build.gradle,但似乎无济于事

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }


    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0+'
    }
}

    apply plugin: 'com.android.library'

    dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    debugCompile project(path: ":CordovaLib", configuration: "debug")
    releaseCompile project(path: ":CordovaLib", configuration: "release")
}

    android {
    compileSdkVersion cdvCompileSdkVersion
    buildToolsVersion cdvBuildToolsVersion
    publishNonDefault true

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }
    }
}

    if (file('build-extras.gradle').exists()) {
    apply from: 'build-extras.gradle'
}

0 个答案:

没有答案