Android studio 金丝雀,摇篮同步失败Android Studio中3.0金丝雀5

这是我build.gradle(Project: MyProjectName)文件:摇篮同步失败Android Studio中3.0金丝雀5

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

ext.kotlin_version = "1.1.1"

ext.supportLibVersion = "25.3.0"

repositories {

jcenter()

}

dependencies {

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"

classpath 'com.android.tools.build:gradle:3.0.0-alpha5'

// NOTE: Do not place your application dependencies here; they belong

// in the individual module build.gradle files

}

}

allprojects {

String osName = System.getProperty("os.name").toLowerCase();

if (osName.contains("windows")) {

buildDir = "C:/tmp/${rootProject.name}/${project.name}"

}

repositories {

jcenter()

}

}

task clean(type: Delete) {

delete rootProject.buildDir

}

这里是build.gradle(Module:app):

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {

compileSdkVersion 25

buildToolsVersion "25.0.2"

defaultConfig {

applicationId "com.example.android.datafrominternet"

minSdkVersion 10

targetSdkVersion 25

versionCode 1

versionName "1.0"

}

buildTypes {

release {

minifyEnabled false

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:25.1.0'

// TODO (32) Remove the ConstraintLayout dependency as we aren't using it for these simple projects

compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7: $kotlin_version"

}

此错误消息:

Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'.

此意外错误的可能原因包括:

Gradle的依赖关系缓存可能已损坏(有时会在网络连接超时后发生)。 重新下载依赖项和同步项目(需要网络)

Gradle构建过程的状态(守护进程)可能已损坏。停止所有的Gradle守护进程可能会解决这个问题。 停止Gradle构建过程(需要重新启动)

您的项目可能使用与项目中的其他插件或项目请求的Gradle版本不兼容的第三方插件。在发生损坏的Gradle进程的情况下,您也可以尝试关闭IDE,然后终止所有Java进程。

+0

1)升级您的科特林版本1.1.2:'科特林1.1.2也带来了Android摇篮版本2.4.0-α的兼容性2)我建议你使用android gradle插件'3.0.0-alpha4'而不是'3.0.0-alpha5',因为最新版本有很多错误 –

+0

感谢您的回复。我做了你所说的,但现在我得到了另一个错误。错误:无法找到com.android.tools.build:gradle:3.0.0-alpha4。 –

+0

选中此:https://stackoverflow.com/questions/44943890/error-after-sdk-update/44943945#44943945 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值