После обновлении Android studio и его библиотеки выводится ошибка
Обновил Android Studio и его библиотеки(gradle, SDK, java, ...) и ещё изменил package, после этого выходит ошибка
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
buil.gradle(:app)
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId MPrayer
minSdkVersion 19
targetSdkVersion 30
versionCode 6
versionName '3.5.1' //new version
multiDexEnabled true //ADD THIS LINE
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.3.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.github.msarhan:ummalqura-calendar:1.1.9'
implementation 'net.alhazmy13.hijridatepicker:library:2.0.2'
implementation 'com.opencsv:opencsv:4.6'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-database:20.0.1'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-ads:20.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-ads:20.2.0'
implementation 'androidx.arch.core:core-runtime:2.1.0'
implementation "com.google.android.play:core:1.10.0"
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
}
gradle version > classpath 'com.android.tools.build:gradle:7.0.0' #пожалуйста помогите
Ответы (1 шт):
Автор решения: Vadik
→ Ссылка
Android Gradle Plugin 7.0 требует для работы JDK 11. Об этом сказано в Release Notes.
Поменяйте Gradle JDK c 8 на 11 в настройках Android Studio: Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK:
