Android项目和Gradle:无法通知项目评估监听器

时间:2017-10-23 08:11:24

标签: android gradle

我有一个包含多个模块的Android Studio项目,我想构建一个模块。 跑步:

./gradlew :installed:assembleDebug 

错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':installed'.
Failed to notify project evaluation listener.
Could not initialize class 
com.android.sdklib.repository.AndroidSdkHandler

Root项目的build.gradle:

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

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-beta4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
    google()
}
}
ext {
 buildTools = "26.0.0"
 compileSdk = 26
 minSdk = 15
 minSdkInstant = 23
 versionCode = 1
 versionName = "1.0"
 supportLib = "25.3.1"
}

已安装模块的build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools

defaultConfig {
    applicationId 
    "com.google.android.instantapps.samples.hellofeature"
    minSdkVersion rootProject.minSdk
    targetSdkVersion rootProject.compileSdk
    versionCode rootProject.versionCode
    versionName rootProject.versionName
}
buildTypes {
    release {}
    debug {}
}
}

dependencies {
implementation project(":features:hello")
implementation project(":features:bye")
}

Android工作室正常运行,问题只发生在命令构建时。 我该怎么办?

0 个答案:

没有答案