Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 15.0.2.
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
// buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 16
targetSdkVersion 22
signingConfig signingConfigs.config
versionCode 9
versionName '3.6'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
// signingConfig signingConfigs.config
}
}
packagingOptions {
// exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':slidingmenu_libs')
implementation project(':sqlite_helper')
implementation files('libs/httpclient-4.2.5.jar')
implementation files('libs/httpcore-4.2.4.jar')
implementation files('libs/httpmime-4.2.1.jar')
implementation files('libs/lib-autonotifyviewpager.jar')
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation('com.twitter.sdk.android:tweet-composer:1.0.3#aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.eftimoff:android-viewpager-transformers:1.0.1#aar'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:4.24.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.1'
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4#aar'
testImplementation 'junit:junit:4.12'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0#aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
Update the google-service plugin to 'com.google.gms:google-services:3.3.0'
However, its always better to have same version among the same library file to prevent any project sync crash.
Example,
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-plus:15.0.2'
sometimes it happens when you updating google play services or firebase dependencies, you might solve it by updating the play service plugin in your build.gradle (project) file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
Related
This question already has an answer here:
Why does case matter in gradle task method names?
(1 answer)
Closed last month.
I am not able to add the GitHub repository of Youtube video extractor for exoplayer, implementing in android studio project.
build.gridle(abc app)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gridle(app)
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.abc"
minSdkVersion 20
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
// multiDexEnabled true
//useProguard true
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.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc03"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation ('com.squareup.retrofit2:retrofit:2.1.0') {
// exclude Retrofit’s OkHttp dependency module and define your own module import
exclude module: 'okhttp'
}
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.payumoney.core:payumoney-sdk:7.4.4'
implementation 'com.payumoney.sdkui:plug-n-play:1.6.0'
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:26.6.0')
// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.android.support:multidex:1.0.3'
//Adding exoplayer dependencies
implementation 'com.google.android.exoplayer:exoplayer:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-core:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:r2.4.0'
//Youtube extractor
Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0' // getting error in this line
}
When I'm trying to add the "Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'", I don't know why showing the below error -
unexpected token: com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0
Could not compile build file 'C:\Users\Rupesh\AndroidStudioProjects\abc\app\build.gradle'.
> startup failed:
build file 'C:\Users\Rupesh\AndroidStudioProjects\abc\app\build.gradle': 84: unexpected token: com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0 # line 84, column 20.
Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'
Use i instead of I in implementation.
The correct line should be
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'
I have a project which was made on Android Studio 3.3 and it was working fine without any issues but now when i have upgraded it to Android Studio 3.4 I am getting this compile error.
I have added that Java 1.8 version and all but non of that helped me.
Here is my Build.APP file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "applicationID"
minSdkVersion 17
targetSdkVersion 28
versionCode 14
multiDexEnabled true
versionName "1.5.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'com.facebook.android:audience-network-sdk:5.1.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.6'
// implementation 'com.google.android.exoplayer:extension-rtmp:2.8.4'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer:2.9.6'
implementation 'com.google.firebase:firebase-database:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-config:16.5.0'
// Firebase Messages
// Add the In-App Messaging depencency:
implementation 'com.google.firebase:firebase-inappmessaging-display:17.1.1'
// Check that your Firebase dependency is up-to-date:
implementation 'com.android.support:cardview-v7:28.0.0'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
apply plugin: 'com.google.gms.google-services'
Here is my Build.Project
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
// 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
}
And here are the Error pictures that i am getting when i try to compile it.
Error 1
I just disable the Instant Run from Preferences and now everything is fine 😕
I'm trying to add following dependencies in build.gradle -
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
But app will keep crashing with following message -
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/util/zzq;
If i'm going to remove firebase from here then the crash will go away. I have tried with firebase version 16.0.6 too but still it will keep crashing.
Following is my app level build.gradle -
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
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:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc02'
implementation 'com.android.support:support-v4:28.0.0-rc02'
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'
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'androidx.slice:slice-core:1.0.0-alpha1'
implementation 'androidx.slice:slice-builders:1.0.0-alpha1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Following is my project level build.gradle -
buildscript {
ext.kotlin_version = '1.2.60'
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-rc02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You should update your dependencies in app gradle file like:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
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:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.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'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
And project gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
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:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.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'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Hope this help you!
you'd have to add apply plugin: "com.google.gms.google-services" at the bottom of the module level's build.gradle (so that the values of google-services.json will be applied to the resources; this file can be downloaded from the Firebase console). most likely, you'd also have to add implementation "com.google.android.gms:play-services-base:16.1.0" to the dependencies, in order to provide that one missing class.
and there are also duplicate com.android.support vs. androidx dependencies; for example:
// implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
...even if it won't throw NoClassDefFoundError, there will be duplicates unless these are fixed. better first fully migrate to androidx and then try to fix the issue with Play Services; because while being right within the half-done process of refactoring, it is rather difficult to attribute an issue to something.
I am using firestore db with no problems until I added:
compile 'com.google.firebase:firebase-
storage:11.8.0'
Now I get the message:
Error:Execution failed for task':app:processDebugGoogleServices'.
Please fix the version conflict either by
updating the version of the google-services
plugin (information about the latest version is
available at
https://bintray.com/android/android-
tools/com.google.gms.google-services/) or
updating the version of com.google.android.gms
to 11.6.0.
I have tried every combination of versions in my
gradle file with no success.
When I comment out ..storage ll.8.0 the app
gradle builds.
Below is my app gradle file:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath '
com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-
services:3.2.0'
}
}
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.XXXXXX.XXXX"
minSdkVersion 16
targetSdkVersion 26
versionName "2.0"
multiDexEnabled true //Add this
testInstrumentationRunner
"android.support.test.runner.
AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles
getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
repositories {
flatDir { dirs "libs" }
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
def BUTTER_KNIFE_VERSION = "8.5.1" //current
version of butterknife
dependencies {
implementation fileTree(include: ['*.jar'],
dir: 'libs')
implementation 'com.android.support:appcompat-
v7:26.1'
implementation
'com.android.support.constraint:constraint-
layout:1.0.2'
implementation(name: "UGrokItApi-release", ext:
"aar")
// support
implementation supportDependencies.appCompat
implementation supportDependencies.support
implementation supportDependencies.design
implementation supportDependencies.recyclerView
implementation supportDependencies.cardView
implementation 'com.google.firebase:firebase-
database:11.6.0'
implementation 'com.google.firebase:firebase-
auth:11.6.0'
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
compile 'com.google.android.gms:play-services-
auth:11.6.0'
compile 'com.google.firebase:firebase-
storage:11.8.0'
compile 'com.android.support:design:26.1.0'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor
'com.jakewharton:butterknife-compiler:8.8.1'
libraries.firebaseUIDatabase
'com.google.firebase:firebase-database:11.6.0'
implementation 'com.firebaseui:firebase-ui-
firestore:3.1.0'
implementation
'com.android.support:design:26.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'
compile 'com.google.firebase:firebase-
firestore:11.6.0'
compile 'com.firebaseui:firebase-ui-
firestore:3.1.0'
compile 'com.android.support:recyclerview-
v7:26.1.0'
compile 'com.android.support:cardview-
v7:26.1.0'
compile 'com.android.support:support-
annotations:27.0.1'
compile 'com.google.android.gms:play-services-
location:11.6.0'
}
apply plugin: 'com.google.gms.google-services'
You have to use the same version in firebase and gms, try to downgrade your firebase version or to increase your gms:
compile 'com.google.firebase:firebase- storage:11.6.0'
All you google play services dependencies need to be on the same version so since you added com.google.firebase:firebase-storage:11.8.0 you now need to update all your other google dependencies to that version
Migrated the project to 'com.android.tools.build:gradle:3.0.1'. Since then I have been getting this error from gradle
Exception in thread "main" java.lang.RuntimeException: Method code too large!
at org.objectweb.asm.MethodWriter.a(Unknown Source)
at org.objectweb.asm.ClassWriter.toByteArray(Unknown Source)
at com.google.devtools.build.android.desugar.CoreLibraryRewriter$UnprefixingClassWriter.toByteArray(CoreLibraryRewriter.java:152)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:403)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDesugarForDebug'.
I have tried Clean Project > Rebuild Project multiple times, it does not help.
Here is my build config:
apply plugin: 'com.android.application'
buildscript {
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
flavorDimensions "default"
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.example.shirish"
minSdkVersion 15
targetSdkVersion 24
multiDexEnabled true
versionCode 140
versionName "3.30"
vectorDrawables.useSupportLibrary = true
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
debug {
testCoverageEnabled = false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
repositories {
maven { url "http://repo.commonsware.com.s3.amazonaws.com" }
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/pixplicity/android" }
maven {
url "http://s3.amazonaws.com/repo.commonsware.com"
}
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
maven {
url 'https://maven.google.com'
}
}
sourceSets {
main {
java {
exclude 'com/google/gdata/util/common/base/UnicodeEscaper$1.class'
exclude 'com/google/gdata/util/common/base/Escaper.class'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/commons-net-3.5.jar')
implementation files('libs/org.apache.http.legacy.jar')
implementation files('libs/PayU-release.jar')
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation files('libs/gdata-contacts-3.0.jar')
implementation files('libs/gdata-client-1.0.jar')
implementation files('libs/gdata-core-1.0.jar')
implementation project(path:':beewisesdk', configuration:'default')
implementation('com.google.code.gson:gson:2.8.2') {
exclude group: 'com.google.gdata'
}
implementation('ch.acra:acra:4.7.0') {
exclude group: 'org.json'
}
implementation group: 'com.zendesk', name: 'sdk', version: '1.9.1.1'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.balysv:material-ripple:1.0.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.wang.avi:library:1.0.5'
implementation 'com.google.guava:guava:19.0'
implementation 'com.github.d-max:spots-dialog:0.4#aar'
implementation 'com.iceteck.silicompressorr:silicompressor:1.1.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.jakob-grabner:Circle-Progress-View:v1.2.9'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.github.ParkSangGwon:TedPicker:v1.0.10'
implementation 'com.facebook.android:facebook-android-sdk:4.28.0'
implementation 'com.cloudinary:cloudinary-android:1.4.2'
implementation 'com.segment.analytics.android:analytics:4.3.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.jakewharton:butterknife:8.1.0'
implementation 'com.kbeanie:multipicker:1.1.3#aar'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
implementation 'com.google.android.gms:play-services-auth:11.4.2'
implementation 'com.google.android.gms:play-services-gcm:11.4.2'
implementation 'com.google.android.gms:play-services-location:11.4.2'
implementation 'com.google.android.gms:play-services-places:11.4.2'
implementation 'com.beardedhen:androidbootstrap:2.3.0'
implementation 'com.webengage:android-sdk:3.1.0'
implementation 'com.google.android.gms:play-services-analytics:11.4.2'
// Google Api Client library and Android extension
implementation ('com.google.api-client:google-api-client:1.23.0') {
exclude group: 'com.google.guava'
}
implementation ('com.google.api-client:google-api-client-android:1.23.0') {
exclude group: 'com.google.guava'
}
//People REST API access
implementation ('com.google.apis:google-api-services-people:v1-rev159-1.23.0') {
exclude group: 'com.google.guava'
}
implementation 'com.droidninja:filepicker:1.0.8'
implementation 'com.razorpay:checkout:1.2.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.github.MAXDeliveryNG:slideview:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-tagmanager:11.4.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.firebase:firebase-perf:11.4.2'
implementation 'com.annimon:stream:1.1.8'
implementation 'com.google.dagger:dagger:2.8'
implementation 'javax.inject:javax.inject:1'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
implementation 'javax.annotation:jsr250-api:1.0'
}
android { sourceSets { main { java.srcDirs = ['src/main/java', 'app/model'] } } }
android { sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/xml'] } } }
android {
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
}
apply plugin: 'com.google.gms.google-services'
Please, let me know if any more details are required. I have tried all the SO questions regarding this issue, nothing works. Need a fresh perspective on this problem. I am also including the dependencies at top-level build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Also, at implementation 'com.android.support:recyclerview-v7:26.1.0' I am getting a warning to use the same version and as you can see in my gradle all support dependencies are the same version.
Update Gradle version:
Android plugin 3.0.0 requires Gradle version 4.1 or higher. If you're opening an existing project using Android Studio 3.0 or later, follow the prompts to automatically update an existing project to the compatible version of Gradle.
To update Gradle manually, edit the URL in gradle-wrapper.properties to the following:
distributionUrl=\
https\://services.gradle.org/distributions/gradle-4.1-all.zip
Apply the plugin
If you're opening an existing project using Android Studio 3.0 or later,
follow the prompts to automatically update your project to the latest
version of the Android plugin. To manually update your project, include the maven repo and change the plugin version in your project-level build.gradle file as follows:
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
For check Gradle Version : File > Project Structure > Project
Also check this : https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
With Android Studio 3.1 and its build view I started getting a more comprehensive error Multiple dex files define Lorg/apache/http/Header;. Hence I checked the usage of the Class org.apache.http.Header which led me to understand that I had multiple apache.http libs and after removing implementation files('libs/org.apache.http.legacy.jar') the build worked.