无法使用Androidx工件在Android Studio 3.3上成功构建新项目?

时间:2019-01-25 18:38:06

标签: android android-studio android-studio-3.3

最近我将android studio 3.2.1更新为3.3,现在我想在android studio 3.3中创建新项目或现有项目,但是每次创建新项目时gradle同步失败

我试图解决此问题的方法
-从根项目中删除.gradle和.idea文件夹并重建
-也会无效缓存/重启android studio

-上面的解决方案是通过搜索stackoverflow来应用的,但在这里都无法解决

App Gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "xxx.xxxxx.xxxxxx"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android- 
optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0- 
alpha4'
}

Project Gradle

buildscript {
repositories {
    google()
    jcenter()

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

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

allprojects {
repositories {
    google()
    jcenter()

}
}

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

当我构建项目时,它显示gradle同步失败,原因如下:

原因:org / gradle / api / publish / ivy / internal / IvyServices $ BuildServices

我只想成功构建新项目或现有项目

0 个答案:

没有答案