skip to Main Content

When I update the project, this message appears in Android Studio,
I want to build the project in the environment "SDK 30 and Android 10",
But I don’t know how to do it.

gradle wrapper properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

build gradle project

buildscript {
    repositories {
        google()
        jcenter() }
    
    dependencies { classpath 'com.android.tools.build:gradle:3.4.3'  }}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

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

build gradle App

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"
    defaultConfig {
        applicationId "com.demo.codev2"
        minSdkVersion 21
        targetSdkVersion 30
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'com.android.support:support-annotations:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation 'com.victor:lib:1.0.4'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.github.chrisbanes:PhotoView:2.0.0'
    implementation 'com.github.krokyze:ucropnedit:2.2.1-native'
    implementation 'com.github.duanhong169:colorpicker:1.1.6'



}

When I update the project, this message appears in Android Studio,
I want to build the project in the environment "SDK 30 and Android 10",
But I don’t know how to do it.

Thank you

enter image description here

2

Answers


  1. Go To SDK Manager > SDK Tools

    check Show Package Detail
    and install SDK Tools 30

    see on here

    Login or Signup to reply.
  2. mavenCentral() (read more here) is missing from your build.gradle.

    Your gradle.build file should look like this:

    buildscript {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
            mavenCentral()
        }
        
        dependencies { classpath 'com.android.tools.build:gradle:3.4.3'  }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
            mavenCentral()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    As the project seems to be deprecated (they recommend this other), if this doesn’t work, you’ll need to download the library and add it manually to the project lib folder.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search