I am trying to run an old project on Android Studio, it used to work fine but now trying to run again without making any changes. I have tried many things but had no success and getting this error. Any help will be appreciated
A problem occurred configuring project ':app'.
I've updated the Gradle version but not sure where it's failing now.
Here is the gravel file.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.name"
minSdkVersion 30
targetSdkVersion 30
versionCode 3
versionName "3.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
// implementation 'com.google.android.gms:play-services-ads:12.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
//implementation 'org.jetbrains.anko:anko-sdk15:0.8.2'
//implementation 'com.beust:klaxon:0.30'
}
apply plugin: 'com.google.gms.google-services'
If this project can run normally in the past, generally only need File -> Invalidate Caches
Related
Why is this Error Getting me While Generating a Signed Apk in Kotlin? Anyone who knows the solution please send an answer.
Logcat Error:
Execution failed for task ':app:lintVitalRelease'.
Lint found fatal errors while assembling a release target.
I'm adding build.gradle file. I don't know what's wrong with my code, So please anyone know solution please answer.
Build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.testing.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
implementation "android.arch.lifecycle:livedata:1.1.1"
kapt "android.arch.lifecycle:compiler:1.1.1"
implementation 'com.karumi:dexter:5.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.anko:anko:$anko_version"
//Anko Commons
implementation "org.jetbrains.anko:anko-commons:$anko_version"
implementation "org.jetbrains.anko:anko-appcompat-v7-commons:$anko_version"
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.github.medyo:android-about-page:1.2.2'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation "com.google.firebase:firebase-ml-model-interpreter:17.0.3"
implementation "com.google.firebase:firebase-ml-vision:19.0.2"
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-crash:16.2.1'
}
apply plugin: 'com.google.gms.google-services'
I had this problem and solved it by adding:
lintOptions {
checkReleaseBuilds false
}
to my build.gradle file within the android{ } section.
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
I'm reading a documents regarding the new glide on how to install on my app, Its quite difficult now since they update the new api and document unlike before and following there instruction, but why I'm getting this error:
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
I tried already so many ways to debug it. but my issue was not still resolve.
Here is my build.grade:app:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.example.app1"
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'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.material:material:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
implementation 'com.google.code.gson:gson:2.8.6'
implementation("com.squareup.okhttp3:okhttp:4.8.1")
kapt 'com.github.bumptech.glide:compiler:4.11.0'
}
It seems you have forgot to add dependancy
try this
dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
}
also add in your this inside of your project level build.gradle file:
repositories {
google()
jcenter()
}
In my gradle, I have a conflict in versions that gives me the error Cannot resolve symbol 'R' but I don't know what is the wrong version.
In my gradle, I have a conflict in versions that gives me the error Cannot resolve symbol 'R' but I don't know what is the wrong version.
Already tried every other solution:
Clean and Rebuild project
Sync project
Clean cache
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.ves.gennaio3"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-ml-vision:17.0.1'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
compile 'com.github.satyan:sugar:1.5'
compile 'com.rmtheis:tess-two:6.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
You cloud try the following:
File -> Invalidate Caches / Restart Android Studio -> Invalidate and Restart
Android Studio maintains information about which files are dependent on which other files. This means you not only have to Gradle sync your files, but you also need to invalidate studio caches.
After I have added the firebase ads dependency implementation'com.google.firebase:firebase-ads:15.0.1'
now I am getting the followiing Error:
Error:The library com.google.firebase:firebase-analytics is being requested by various other libraries at [[15.0.1,16.0.0), [16.0.0,16.0.0], [16.0.0,99999]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
but I haven't added a analytics dependency since I don't need that, but I added it anyway to see weather it solves the problem but I am still getting the same error
the following is my build.gradle(module app)
//noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.rimapps.midippu"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:support-annotations:27.1.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
//noinspection GradleDynamicVersion
implementation 'com.android.support:cardview-v7:26.1.0+'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.0'
apply plugin: 'com.google.gms.google-services'
implementation'com.google.firebase:firebase-analytics:16.0.0'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
Is there anything I can do?
It worked after I updated my classpath dependency to classpath 'com.google.gms:google-services:4.0.1' in my project gradle
Can anyone tell my why dagger2 isn't working for me in Android Studio 3.1 preview?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.orbitlab.mowerapp"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'com.google.firebase:firebase-database:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation "com.google.firebase:firebase-firestore:11.4.2"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.google.android.gms:play-services-fitness:11.4.2'
implementation 'com.google.android.gms:play-services-auth:11.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
implementation 'com.google.dagger:dagger:2.10'
}
apply plugin: 'com.google.gms.google-services'
This is how my app's build.gradle file looks like. I haven't added anything in the project's build.gradle file.
Can anyone help?
Edit:
The gradle syncs now, but i get dex errors when trying to deploy to my device (havent used Dagger in this project yet).
The error is:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
Try to update dagger version and check it like this.
annotationProcessor 'com.google.dagger:dagger-compiler:2.10'
implementation 'com.google.dagger:dagger:2.10'
You need to add following code to gradle file,
android {
defaultConfig {
multiDexEnabled true
}
}
Then,
1.Clean your project
2.Build the code