2

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

adam_p87
  • 23
  • 3
  • The error says a library cannot be found, add the repositories. I don't think it has something to do with android 10 – cmak Mar 09 '22 at 17:59
  • How can I do that. I tried many solutions but it didn't work for me – adam_p87 Mar 09 '22 at 18:49

2 Answers2

0

Go To SDK Manager > SDK Tools

check Show Package Detail and install SDK Tools 30

see on here

taqin
  • 29
  • 4
0

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.

cmak
  • 576
  • 1
  • 4
  • 15
  • It doesn't work ... What is way to download it? – adam_p87 Mar 09 '22 at 20:10
  • Did you sync gradle after editing the file? – cmak Mar 09 '22 at 20:11
  • Yes. I did & I cleaned the project – adam_p87 Mar 09 '22 at 20:27
  • OK, so it seems the library was using JCenter https://github.com/donglua/PhotoPicker/issues/174 which is now deprecated and may not work always (or maybe the author deleted it). So the only way would be to download the Github project and either compile it or add the files manually to your project. You can also check out the other project https://github.com/zhihu/Matisse which I tested and works (but also seems to use JCenter). – cmak Mar 09 '22 at 23:10