I have updated my apps build tools to 28.0.0. The application fails to install to device due to the following error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexBuilderForDebug'
If I remove Lombok dependecies then everything runs without any issues.
I can't seem to figure what is the problem and am not able to find info about this online. Any thoughts?
My app gradle config:'
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "my.package.budgeter"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
compileOnly 'org.projectlombok:lombok:1.18.2'
annotationProcessor 'org.projectlombok:lombok:1.18.2'
}
Found out that there is an issue with 1.18.2 version.
Rolled back to version 1.16.20. This fixed the issue.
Related
I have the following line in my MainActivity.java that is giving the error...
import com.google.firebase.messaging.FirebaseMessaging;
Which gives error:
error: package com.google.firebase.messaging does not exist
My app level build.gradle has the dependency added...
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.tenera.fcm_reliability_test_android_native_client"
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 platform('com.google.firebase:firebase-bom:31.1.0')
implementation platform('com.google.firebase:firebase-messaging')
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'
}
The build process does not complain about any issue with the build.gradle, so I assume it is configured correctly (according to the firebase docs). I am not sure what else I can do to diagnose this issue, since there is no indication that the build file is misconfigured.
enter image description here
Hi I'm learning Android studio new and I bought the source from CodeCanyon and solved some errors, but I got stuck in this error:
No variants found for ':app'. Check build files to ensure at least one variant exists.
I checked cdk tools and everything seems fine and I also searched for answers and tried them but I couldn't solve this error.
here is my code :
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId 'com.quraan.farroukh'
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
ndk {
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
dependencies{
task wrapper(type: Wrapper){
gradleVersion = '2.14.1'
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.gms:play-services-ads:20.2.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'com.google.android.gms:play-services-analytics-impl:17.0.0'
implementation 'com.github.varunest:sparkbutton:1.0.6'
implementation 'com.airbnb.android:lottie:3.6.1'
implementation 'com.github.glomadrian:Grav:1.1'
implementation 'hanks.xyz:htextview-library:0.1.5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'io.saeid:fab-loading:1.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
}
I guess, you probably didn't install SDK 29.
Go to File->Settings->Appearance and Behaviour->System Settings->Android SDK
Check the specific version of API Level and install it if it's missing
I'm completely new to android and I'm trying some stuff. But there is a problem that I can't resolve. I'm trying to import some android support library and even if it seems like I did it properly by adding google() to my Gradle build, and by clicking Sync Now there is an error. I even used the project structure manager to add the dependencies and it still appears red.
Here is my build.gradle module file :
plugins {
id 'com.android.application'
}
allprojects {
repositories {
google()
}
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.avoidspleen.exossupspe"
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
// Appears red from now
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
// End of red
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
I'm using JetBrains toolbox to update Android Studio version 4.1.2.
I used 1.3.4 version and everything was fine but I started using 2.1.9 version and I have mistake"Cannor resolve symbol 'rx'"
This is my Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.max.project_oo1_client_server"
minSdkVersion 15
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.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'
compile 'io.reactivex.rxjava2:rxjava:2.1.9'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
}
the problem is in your import statements.
Search : import rx.Observable;
Replace: import io.reactivex.Observable;
repeat this for all classes.
you can use search and replace but be carefull :
Ctrl+Shift+R on Windows and Linux/Ubuntu
Cmd+Shift+R on Mac OS X
I have problem with Gradle building for Android. I tried a lot of methods for resolve this problem but nothing is not working. I need help.
Gradle version: 4.4
Gradle plugin: 3.0.1
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 21
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'
}
}
buildToolsVersion '26.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "group1"
productFlavors {
server {
versionName '0.1'
minSdkVersion 21
targetSdkVersion 26
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
versionCode 1
dimension "group1"
}
mock {
minSdkVersion 21
targetSdkVersion 26
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
versionCode 1
versionName '0.1'
dimension "group1"
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.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.arello-mobile:moxy:1.5.3'
annotationProcessor 'com.arello-mobile:moxy-compiler:1.5.3'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.google.code.gson:gson:2.8.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.13'
implementation 'com.google.dagger:dagger:2.13'
implementation 'com.google.guava:guava:23.5-android'
implementation 'com.vk:androidsdk:1.6.9'
implementation project(':vksdk_library')
}
Error:Unable to resolve dependency for ':app#serverDebug/compileClasspath': Could not resolve project :vksdk_library.
Error:Unable to resolve dependency for ':app#mockDebugAndroidTest/compileClasspath': Could not resolve project :vksdk_library.
Error:Unable to resolve dependency for ':app#mockDebugUnitTest/compileClasspath': Could not resolve project :vksdk_library.
Error:Unable to resolve dependency for ':app#serverRelease/compileClasspath': Could not resolve project :vksdk_library.
As from docs, gradle dependency section You can use
implementation 'com.vk:androidsdk:1.6.9'
instead of adding the whole project yourself
Note: you also must have maven support added in your project
As mentioned here in docs rest leave it gradle to download and link library