Olá, boa tarde,
Obrigado pela ajuda!
Mas ainda não funcionou.
Veja que eu estou usando o projeto do jeito que veio após descompactar, não adicionei nenhum plugin de terceiro ou algo do tipo.
Após fazer as alterações que você sugeriu, ao tentar fazer o build clean ou qualquer outro tipo de sincronização retorna o erro:
Build file 'C:\Users\SCCL2402\AndroidStudioProjects\android-tech-news\app\build.gradle' line: 10
A problem occurred evaluating project ':app'.
> No signature of method: build_7bufxyftgr2kj8n389istl43y.android() is applicable for argument types: (build_7bufxyftgr2kj8n389istl43y$_run_closure1) values: [build_7bufxyftgr2kj8n389istl43y$_run_closure1@5352745f]
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':app'.
ultScriptRunnerFactory.java:91)
... 148 more
O meu arquivo build.gradle (:app) está assim:
//apply plugin: 'com.android.application'
//apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
//apply plugin: 'kotlin-kapt'
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
defaultConfig {
applicationId "br.com.alura.technews"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
androidExtensions {
experimental = true
}
compileOptions {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
def room_version = "2.0.0"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// implementation 'androidx.appcompat:appcompat:1.0.2'
// implementation 'androidx.core:core-ktx:1.0.1'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.13.1'
}
Enquanto o aquivo build.gradle (android-tech-news) está assim:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
// ext.kotlin_version = '1.3.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
E o arquivo gradle-wrapper.properties:
#Mon Apr 01 09:10:17 BRT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
Eu apaguei também toda a pasta ~/.gradle/caches/ com tudo que tinha dentro.