Flutter Android Build Gradle配置根项目“ android”时出错?

时间:2018-10-20 21:20:10

标签: android gradle flutter build.gradle

尝试从Flutter运行我的android项目时遇到以下错误...

  

`在配置根项目'android'时发生问题。

     

无法获取根项目“ android”的未知属性“ android”   键入org.gradle.api.Project。`

这是我的android / build.gradle文件...

buildscript {
    ext.kotlin_version = '1.2.51'
    repositories {
        google()
        jcenter()
        maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.2, 0.99.99]'
    }
}

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
//subprojects {
//    project.evaluationDependsOn(':app')
//}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.0.1"
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

0 个答案:

没有答案