Android Studio предлагает обновить Gradle до 8.2.1, но не можетJAVA

Программисты JAVA общаются здесь
Ответить
Гость
 Android Studio предлагает обновить Gradle до 8.2.1, но не может

Сообщение Гость »

Я пытаюсь обновить Gradle до самой последней версии. Я знаю, что 8.2.1 возможно- не только Android Studio предлагает его в качестве опции, но и на веб-сайте Gradle даже говорит, что 8.2.1 больше не является самой современной версией (8.3). Однако, когда он идет и ищет 8.2.1 в репозиториях Maven, он не может его найти. Я также скачал 8.2.1 и поместил ссылку на нее в gradle-wrapper.properties, и это тоже не помогает. Это дает мне эту ошибку, когда я пытаюсь синхронизировать gradle: < /p>

Что пошло не так:
возникла проблема, настраивая корневой проект 'StarterApp'. < / li>
< /ul>

Не удалось разрешить все файлы для конфигурации ': classpath'.
не может найти com.android.tools.build : Gradle: 8.2.1.
Поиск в следующих местах:
- https://dl.google.com/dl/android/maven2 ... gradle/8.2. 1/gradle-8.2.1.pom

Я посмотрел внутри репозитория Google, и, конечно, у него не было самой последней версии Gradle On его веб -сайт. SMH Любые идеи о том, как заставить Android Studio найти правильную информацию, чтобы она могла завершить обновление до 8.2.1 (или, черт возьми, даже 8.3 будет еще лучше, хотя это не было предложено Android Studio, я знаю, что он существует) Будьте хорошим.buildscript {
ext.kotlin_version = '1.8.20'
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
}
}

allprojects {
repositories {
mavenLocal()
maven { url "https://jitpack.io" }
}
}
buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
< /code>
build.gradle (module): < /p>
plugins {
id 'com.android.application'
}

android {
namespace 'com.example.starter'
compileSdk 34

defaultConfig {
applicationId "com.example.starter"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs += '-Xlint:deprecation'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.exifinterface:exifinterface:1.3.6' // check for the latest version online
implementation 'androidx.activity:activity:1.7.2'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'androidx.fragment:fragment:1.6.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation 'androidx.navigation:navigation-fragment:2.7.2'
implementation 'androidx.navigation:navigation-ui:2.7.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}'
< /code>
gradle.properties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/user ... nment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/user ... d_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/lib ... ndroidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
< /code>
gradle-wrapper.properties:
#Tue Aug 08 17:09:22 PDT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=file:///C:/Gradle/gradle-8.2.1-bin.zip

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists


Подробнее здесь: https://stackoverflow.com/questions/770 ... 1-but-cant
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»