當我更新專案時,Android Studio 中出現此訊息,我想在“SDK 30 和 Android 10”環境中構建專案,但我不知道該怎么做。
gradle 包裝器屬性
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
構建 gradle 專案
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
}
構建 gradle 應用程式
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'
}
當我更新專案時,Android Studio 中出現此訊息,我想在“SDK 30 和 Android 10”環境中構建專案,但我不知道該怎么做。
謝謝
在此處輸入影像描述
uj5u.com熱心網友回復:
mavenCentral()(在此處閱讀更多內容)在您的build.gradle.
您的 gradle.build 檔案應如下所示:
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
}
由于該專案似乎已被棄用(他們推薦另一個),如果這不起作用,您需要下載該庫并將其手動添加到專案lib檔案夾中。
uj5u.com熱心網友回復:
去SDK Manager > SDK Tools
檢查Show Package Detail
并安裝SDK Tools 30
看這里
uj5u.com熱心網友回復:
嘗試這個-
用這個替換你以前的實作并同步
implementation 'me.iwf.photopicker:PhotoPicker:0.9.10'
要么
implementation 'me.iwf.photopicker:PhotoPicker:0.9.12'
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/441084.html
