i am getting error in Gradle of Android Studio - android-studio

I am developing a music player app since 10 days. Recently, Android Studio asked me to update but after updating there are some gradle and code errors showing.
the error message due to 200 lines i am able to give here is i upload image
I tried all ways to solve but I have no other option so please tell me the solve
Here are the gradle details
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.example.h3mplayer'
compileSdk 33
defaultConfig {
applicationId "com.example.h3mplayer"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures{
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'androidx.media:media:1.6.1'
implementation "android.arch.lifecycle:extensions:1.1.1"
dependencies {
implementation 'com.github.bumptech.glide:glide:4.14.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
}
}
I tried the last gradle version but also showing some error please help me out

Related

After updating compileSdk to version 33, part of the attributes in design stopped being displayed

After updating the androidx.appcompat library:appcompat:1.5.1 to version 1.6.0 android studio gave me this error message:
error message
I have updated compileSdk and versionSdk from version 32 to version 33. After that, most of the attributes were no longer displayed in the Design mode for the elements.
attributes before | attributes after
build.gradle (app):
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.gramzin.kilo"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding = true
}
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:31.2.0')
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database-ktx:20.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'androidx.activity:activity-ktx:1.5.1'
}
I tried changing the gradle version to 7.4.2 and the android gradle plugin version to 7.2.2, but it doesn't help.
I updated android studio and gradle to the latest version and everything worked

android libraries errors

i am working on an android studio project, when i run the project it crashes immedietly, i tried to debug and i found that the problem is in the methods i use from the android libraries as in the pic here
(https://i.stack.imgur.com/a6bKI.png)
i updated the android SDK
repaired the IDE
added the depencencies needed to the build.gradle file but the problem is not solved
bellow is the build.gradle
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.readerapp'
compileSdk 33
defaultConfig {
applicationId "com.example.readerapp"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
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 'androidx.appcompat:appcompat:1.5.1'
implementation "androidx.annotation:annotation:1.5.0"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation 'com.google.android.material:material:1.5.0'
implementation files('libs\\uhfcom13_eu_v15.jar')
implementation files('libs\\SerialPort.jar')
}
Go To: File->Invalidate Caches-> Rebuild Project
I faced the same issue and that fixed my problem.
implementation files('libs\\uhfcom13_eu_v15.jar')
implementation files('libs\\SerialPort.jar')
Replace with:
implementation files('libs\uhfcom13_eu_v15.jar')
implementation files('libs\SerialPort.jar')

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. error in android studio version dolphin 2021.3.1

My Android Studio Current version Dolphin 2021.3.1 patch 1, in my project I am getting following build error in empty project while adding a fresh dependency. ie.
implementation 'io.github.amrdeveloper:codeview:1.3.7'
getting from here >>> https://amrdeveloper.github.io/CodeView/install/#main-features
I have already checked lots of Solutions related this question but no luck.
build.gradle:project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
}
build.gradle:module
plugins {
id 'com.android.application'
}
android {
namespace 'com.myvpn.myapp'
compileSdk 32
defaultConfig {
applicationId "com.myvpn.myapp"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
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 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
//added these two dependencies
implementation 'io.github.amrdeveloper:codeview:1.3.7'
implementation 'com.github.AmrDeveloper:CodeView:1.3.7'
}
Build Output.
enter image description here
i have tried turn off the Toggle Offline Mode .
enter image description here

Gardle sync error due to dependency being unresolvable

I am currently developing an android app with AR features using the library com.gorisse.thomas.sceneform:sceneform:1.21.0. It was working fine up until now. Whenever I try to sync the project the dependency is not resolvable.
I once had this exact same problem, but a simple computer restart resolved the issue. Now that doesn't work anymore. I tried deleting the .idea and .gradle folders and importing the project instead of opening it.
More details:
The error I get:
Failed to resolve: com.gorisse.thomas.sceneform:sceneform:1.21.0
Show in Project Structure dialog
Show Details
Affected Modules: app
What my build.gradle looks like:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 33
packagingOptions {
resources {
pickFirsts += ['META-INF/DEPENDENCIES']
}
}
buildFeatures {
viewBinding true
}
defaultConfig {
applicationId "com.example.rocksterapp"
minSdk 29
targetSdk 33
versionCode 1
versionName "1.0"
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
}
androidResources {
noCompress 'filamat', 'ktx'
}
namespace 'com.example.<appname>'
}
dependencies {
implementation 'com.google.android.filament:filamat-android:1.21.1'
implementation 'com.gorisse.thomas.sceneform:sceneform:1.21.0'
implementation 'androidx.fragment:fragment-ktx:1.5.3'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-ui:2.5.2'
implementation 'androidx.navigation:navigation-fragment:2.5.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Edit:
I created a new project and just simply copied every file from the old one into it. Problem isn't fixed. Now not only one dependency can't be resolved but three. Sceneform is not included in these.

Execution failed for task ':app:mergeDebugResources' occur while running the app

I am a beginner in android studio. When I try to run the app on my mobile phone, android studio shows me this error:
"execution failed for task ':app:mergedebugresources'. A failure
occurred while executing
com.android.build.gradle.internal.res.ResourceCompilerRunnable"
My build gradle(app):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.example.newlogin2"
minSdkVersion 16
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'
}
}
aaptOptions{
cruncherEnabled = false
useNewCruncher = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:21.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation 'com.google.firebase:firebase-analytics'
}
Any one can help please? Thank you!
Check your code if you follow some tutorials and then
go to
file -> invalidate caches/Restart

Resources