Build errors after Android Studio 3.2.1 upgrade

前端 未结 9 1319
我在风中等你
我在风中等你 2020-11-29 00:24

I am building a sample project from Udacity. This was working fine till now, but after upgrading to Android Studio 3.2.1, I am facing the build error below.

Gradle v

相关标签:
9条回答
  • 2020-11-29 01:14

    Change your build.gradle as follows.

    android {
        compileSdkVersion 26
        buildToolsVersion "28.0.3"
    
        defaultConfig {
            applicationId "your package name here"
            minSdkVersion 15
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        testImplementation 'junit:junit:4.12'
        implementation 'com.android.support:appcompat-v7:26.1.0'
    }
    
    0 讨论(0)
  • 2020-11-29 01:17

    clear gradle cache

    rm -rf $HOME/.gradle/caches/
    

    and resync to download all dependencies

    0 讨论(0)
  • 2020-11-29 01:21

    Add Google repository in your build.gradle(Project:xxxxx)

    allprojects {
        repositories {
            google()
        }
    }
    
    0 讨论(0)
提交回复
热议问题