Sometimes !transformDexArchiveWithExternalLibsDexMergerForDebug - android

I am using implementation 'com.android.billingclient:billing:1.1' dependency to implement in app purchase billing. but i am getting Unable to merge dex
Caused by: com.android.dex.DexException: Multiple dex files define Lcom/android/vending/billing/IInAppBillingService
Error:Execution failed for task Execution failed for task app:transformDexArchiveWithExternalLibsDexMergerForDebug
java.lang.RuntimeException com.android.builder.dexing.DexArchiveMergerException
Unable to merge dex
Below is my build.gradle app level file code
apply plugin: 'com.android.application'
//def BUTTER_KNIFE_VERSION = "8.5.1" //current version of butterknife
repositories {
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.app.syncyes"
multiDexEnabled true
minSdkVersion 19
targetSdkVersion 27
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
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$project.versionName"
implementation "com.android.support:exifinterface:$project.versionName"
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation "com.android.support:design:$project.versionName"
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:support-v4:27.1.1'
// sinch audio calling
implementation(name: 'sinch-android-rtc', version: '+', ext: 'aar')
// compile 'com.google.android.gms:play-services:12.0.1'
// implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
// Multidex
implementation 'com.android.support:multidex:1.0.3'
// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.0.2'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation "com.google.firebase:firebase-core:16.0.3"
// firebase database
implementation 'com.google.firebase:firebase-database:16.0.2'
// videocache
implementation 'com.danikula:videocache:2.7.0'
// InApp Billing
implementation 'com.android.billingclient:billing:1.1'
// // firebase notification
implementation 'com.google.firebase:firebase-messaging:17.3.1'
// compile 'com.google.firebase:firebase-core:16.0.0'
// video compressor
implementation 'com.github.WindSekirun:MediaResizer:1.0.0'
// Dexter runtime permissions
implementation 'com.karumi:dexter:4.2.0'
implementation 'com.github.darsh2:MultipleImageSelect:3474549'
// twitter sharing
implementation('com.twitter.sdk.android:tweet-composer:1.0.5#aar') {
transitive = true;
}
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation('com.facebook.android:account-kit-sdk:4.23.0') {
exclude group: 'com.google.android.gms', module: 'play-services-auth-api-phone'
exclude group: 'com.google.android.gms', module: 'play-services-auth'
}
}
// annotationProcessor "com.jakewharton:butterknife-compiler:$BUTTER_KNIFE_VERSION"
apply plugin: 'com.google.gms.google-services'
Below is my project level build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.gms:google-services:4.0.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"
}
maven {
url 'https://maven.fabric.io/public'
}
}
project.ext{
myBuildToolsVersion="20.0.0" //String
myMinSdkVersion=10 //Integer
myTargetSdkVersion=22
myCompileSdkVersion=27
// ext.versionName = '27.1.1'
versionName = '27.1.1'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Try to clean the project, then it should work.

Related

Duplicate jar entry - android

Am getting this warning during my build .
Warning: Exception while processing task java.io.IOException: Can't
write
[/Users/petrose/as_projects/MrPhone/app/build/intermediates/transforms/proguard/debug/0.jar]
(Can't read
[/Users/petrose/.gradle/caches/transforms-1/files-1.1/firebase-analytics-impl-16.2.4.aar/288ad7982e8f6024c8b5f0954f183721/jars/classes.jar(;;;;;;;**.class)]
(Duplicate jar entry
[com/google/android/gms/internal/measurement/eo.class]))
apply plugin: 'com.android.application'
//apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'org.greenrobot.greendao'
//apply plugin: 'io.fabric'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "....."
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
multiDexEnabled true
resConfigs "en"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled true
useProguard true // obfuscate
shrinkResources true
}
debug {
minifyEnabled true
useProguard true // obfuscate
shrinkResources false
}
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
greendao {
schemaVersion 1
}
dependencies {
//extLib
implementation files('libs/YouTubeAndroidPlayerApi.jar')
//support Lib
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support:support-vector-drawable:28.0.0"
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLibraryVersion"
implementation "com.android.support:customtabs:28.0.0"
//Google API Client Library
implementation('com.google.apis:google-api-services-youtube:v3-rev195-1.23.0') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'com.google.guava'
}
implementation('com.google.api-client:google-api-client-android:1.23.0') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'com.google.guava'
}
// implementation('com.google.apis:google-api-services-calendar:v3-rev309-1.23.0') {
// exclude group: 'org.apache.httpcomponents'
// exclude group: 'com.google.guava'
//
// }
// image
//implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
// implementation 'com.android.support:support-v4:27.1.1'
// implementation 'com.android.support.constraint:constraint-layout:1.1.0'
//annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion"
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'
implementation 'com.commit451:PhotoView:1.2.4'
//Network
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation "com.squareup.retrofit2:retrofit:$rootProject.retorfitVersion"
implementation 'com.squareup.retrofit2:converter-scalars:2.2.0'
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retorfitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retorfitVersion"
implementation 'org.jsoup:jsoup:1.10.3'
// parser
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
implementation 'com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serialisers:1.6.0'
//parceler
implementation 'org.parceler:parceler-api:1.1.12'
annotationProcessor 'org.parceler:parceler:1.1.12'
// database
implementation "org.greenrobot:greendao:$rootProject.greenDaoVersion"
debugImplementation "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"
//eventBus
implementation "org.greenrobot:eventbus:$rootProject.greenrobotVersion"
//DI
implementation "com.google.dagger:dagger-android:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
implementation 'javax.inject:javax.inject:1'
compileOnly 'javax.annotation:jsr250-api:1.0'
// reactive
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
implementation "com.github.miguelbcr:RxPaparazzo:$rootProject.rxRxPaparazzo"
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
implementation "com.github.akarnokd:rxjava2-extensions:0.18.7"
//butterknife
implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"
// logger
implementation "com.jakewharton.timber:timber:$rootProject.timberVersion"
implementation "com.github.nisrulz:easydeviceinfo-base:$rootProject.easyDeviceInfoVersion"
implementation 'com.github.tslamic:dn3:3.0'
//Firebase crash analytics
//implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
// facebook sdk
// implementation "com.facebook.android:facebook-android-sdk:$rootProject.facebookAndroidSDK"
// implementation "com.facebook.android:audience-network-sdk:$rootProject.facebookNetworkSDK"
implementation 'com.facebook.android:facebook-login:4.28.0'
implementation 'com.facebook.android:audience-network-sdk:5.1.0-beta'
// google sdk
// implementation "com.google.android.gms:play-services-analytics:$rootProject.googleLibraryVersion"
implementation('com.google.android.gms:play-services-analytics:16.0.4') {
exclude group: 'com.google.guava'
}
implementation('com.google.android.gms:play-services-ads:17.0.0') {
exclude group: 'com.google.guava'
}
implementation('com.google.android.gms:play-services-auth:16.0.0') {
exclude group: 'com.google.guava'
}
implementation('com.google.android.gms:play-services-gcm:16.0.0') {
exclude group: 'com.google.guava'
}
// fireBase libraries
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.3'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
implementation 'com.google.firebase:firebase-appindexing:17.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
//implementation 'com.google.firebase:firebase-perf:16.2.3'
//implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
//leak
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
//releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
//testLib
//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'
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.1'
}
}
}
}
//Top-level build file
buildscript {
repositories {
google()
jcenter()
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
classpath 'io.fabric.tools:gradle:1.27.0'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
While preparing for output jar (0.jar) at path {module}/build/intermediates/transforms/proguard/debug/0.jar, gradle copies all dependent library classes.jars and there dependent classes.jar to form a single intermediate jar. So when 2 different libraries are dependent on a single module, that single module is copied twice while leads to this error.
This can be solved by marking compileOnly to that single module in libraries which are using that module.

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing

I am getting this error while building my app (or running it).
Caused by: com.android.tools.r8.utils.AbortException: Error: Interface com.google.android.gms.common.data.DataBuffer(classpath class) used as super class of com.google.android.gms.games.multiplayer.ParticipantBuffer.
I have tried everything (from cleaning up project to invalidating caches and restarting android studio), but this error is not going anywhere and I have no idea what to do. So can help me find any solution for this error?
Here is my app level gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
lintOptions {
disable 'ValidFragment'
checkReleaseBuilds false
}
defaultConfig {
applicationId "com.littmedia.littapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0.20170624"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
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')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation project(':firebase_plugin')
implementation project(':sdk')
implementation('com.crashlytics.sdk.android:crashlytics:2.6.7#aar') {
transitive = true;
}
implementation project(':facebook')
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-games:16.0.0'
implementation 'com.google.android.gms:play-services-plus:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.3'
implementation 'ch.acra:acra:4.9.2'
implementation 'com.koushikdutta.ion:ion:2.1.9'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.1.9'
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'org.jdeferred:jdeferred-android-aar:1.2.4'
implementation('de.greenrobot:greendao:1.3.7#jar') {
exclude group: 'com.google.android', module: 'support-v4'
}
implementation 'org.apache.commons:commons-lang3:3.3.2#jar'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And here is my project level gradle file
buildscript {
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://dl.bintray.com/drummer-aidan/maven" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Let me know if you need anything else. Thanks in advance.

Configuration 'compile' with android.enableAapt2

When press try again show me some problems.
These are the settings I used in the build.gradle of my application:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.abc.callrecorder'
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName '1.1'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.gu:option:1.3'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-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.android.support:support-vector-drawable:26.1.0'
implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.microsoft.onedrivesdk:onedrive-picker-android:v2.0'
implementation 'com.alimuzaffar.lib:pinentryedittext:1.3.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jaredrummler:android-device-names:1.1.4'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.jakewharton:butterknife:6.0.0'
implementation 'com.github.AmniX:MaterialPatternllockView:7a45dcaa79'
implementation 'com.scottyab:aescrypt:0.0.1'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-iid:17.0.0'
implementation 'com.google.firebase:firebase-iid-interop:16.0.1'
implementation 'com.google.firebase:firebase-messaging-license:12.0.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
These are the setting in build.gradle application:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
maven { url 'http://guardian.github.com/maven/repo-releases' }
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
These are mistakes :
The option 'android.enableAapt2' is deprecated and should not be used
anymore. Use 'android.enableAapt2=true' to remove this warning. It
will be removed at the end of 2018..
Configuration 'compile' is obsolete and has been replaced with
'implementation' and 'api'. It will be removed at the end of 2018. For
more information see:
http://d.android.com/r/tools/update-dependency-configurations.html

Program type already present com google protobuf DescriptorProtos

After a couple of hours I decided to share my problem.
// Root build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath "io.realm:realm-gradle-plugin:5.4.1"
}
}
allprojects {
repositories {
google()
jcenter()
maven {url 'http://jitpack.io'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// App build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
repositories {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url 'https://dl.bintray.com/siclo/SicloAndroidOSS' }
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
dexOptions {
javaMaxHeapSize "4g"
jumboMode true
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
multiDexEnabled true
applicationId "my.chart.card.app"
minSdkVersion 17
targetSdkVersion 28
versionCode 63
versionName "2.1.7"
vectorDrawables.useSupportLibrary = true
}
// SOME GRADLE CODE BUT I CUT IT (build release ...)
ext.ANDROID_SUPPORT_LIBRARY_VERSION = "28.0.0"
ext.GOOGLE_PLAY_VERSION = "16.0.0"
ext.FIREBASE_VERSION = "16.0.4"
dependencies {
configurations {
all*.exclude group: 'com.android.support', module: 'support-v13'
all*.exclude group: 'com.google.firebase', module: 'firebase-crash'
all*.exclude group: 'com.google.protobuf', module: 'protobuf-lite'
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:support-v4:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:exifinterface:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:percent:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.android.support:cardview-v7:' + ANDROID_SUPPORT_LIBRARY_VERSION
implementation 'com.google.android.gms:play-services-location:' + GOOGLE_PLAY_VERSION
implementation 'com.google.android.gms:play-services-places:' + GOOGLE_PLAY_VERSION
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.google.firebase:firebase-core:' + FIREBASE_VERSION
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:' + FIREBASE_VERSION
implementation 'com.google.firebase:firebase-storage:16.0.3'
implementation ('com.firebaseui:firebase-ui-firestore:4.2.0') {
exclude group: "com.google.protobuf", module: "protobuf-lite"
}
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.simmorsal.library:concealer_nested_scroll_view:2.0.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.gmail.samehadar:iosdialog:1.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
implementation 'io.card:android-sdk:5.5.1'
implementation 'com.google.guava:guava:23.6-android'
implementation 'com.cleveroad:slidingtutorial:1.0.8'
implementation 'com.github.takusemba:spotlight:1.1.3'
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.irozon.sneaker:sneaker:1.0.3'
implementation('com.lamudi.phonefield:phone-field:0.1.3#aar') {
transitive = true
}
implementation 'uk.co.deanwild:flowtextview:2.0.2#aar'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.facebook.android:facebook-login:4.37.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.algolia:algoliasearch-android:3.+'
implementation 'com.github.takusemba:multisnaprecyclerview:1.3.3'
implementation 'com.github.livefront:bridge:v1.1.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.commonsware.cwac:provider:0.5.0'
implementation 'io.intercom.android:intercom-sdk-base:5.+'
implementation('io.intercom.android:intercom-sdk-fcm:5.+') {
exclude group: 'io.intercom.android', module: 'intercom-sdk-base'
}
implementation 'com.siclo.ezphotopick:library:1.0.8'
}
apply plugin: 'com.google.gms.google-services'
Since I updated to 3.2.1 and google play services to 4.1.0 and added Firebase/Firestore libraries I got this error :
Error: Program type already present: com.google.protobuf.DescriptorProtos$DescriptorProto$Builder
I tried ./gradlew :app:dependencies > ./dependencies.txt and exclude protobuff like this exclude group: "com.google.protobuf", module: "protobuf-lite" but it seems to be wrong, still the error.
gradle-4.6-all.zip
Android studio 3.2
If someone encounters the same problem and have some solution,it would be nice.
The duplicate one was inside this lib
implementation('com.lamudi.phonefield:phone-field:0.1.3#aar')
But I don't know why ./gradlew :app:dependencies didn't show the evidence.
The problem comes from your com.lamudi.phonefield dependency. There is a googlecode dependency that causes the crash.
Try to fork and update to implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.3'
The lib is not maintained anyway. Otherwise, there is this fork existing: https://github.com/ialokim/android-phone-field
Downgrading firestore to v12.0.0 removes this conflict

fire base and google play services can't resolve exception

I'm trying to build my application with the following gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.0 rc1'
defaultConfig {
applicationId "com.wallet"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-
ancom.android.supportnotations'
})
implementation('com.alibaba.android:ultraviewpager:1.0.6.1#aar') {
transitive = true
}
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.koushikdutta.ion:ion:2.2.1'
implementation 'com.airbnb.android:lottie:2.5.4'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.orhanobut:logger:2.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.google.android.gms:play-services-ads-identifier:15.0.1'
implementation 'io.michaelrocks:libphonenumber-android:8.8.2'
implementation 'com.github.tamir7.contacts:contacts:1.1.7'
implementation 'com.cleveroad:slidingtutorial:1.0.8'
implementation "android.arch.persistence.room:runtime:1.1.1"
implementation "android.arch.lifecycle:runtime:1.1.1"
implementation "android.arch.lifecycle:extensions:1.1.1"
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
implementation 'com.appyvet:materialrangebar:1.4'
implementation "com.github.nisrulz:qreader:2.1.2"
implementation project(':library')
testImplementation 'junit:junit:4.12'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
project' gradle file:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven { url "https://dl.bintray.com/krazykira/maven" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I'm getting the following error:
Failed to resolve: play-services-base
Failed to resolve: play-services-ads-identifier
when I change the play-services-base version to 15.0.0 this error is fixed but when I do the same for play-services-ads-identifier there's no change. Is there anyway for me to understand what is the problem or how can I make the app work with the current versions?
Any help would be appreciated 3>
For reasons unknown to me, google() must appear before jcenter() in the list of repositories, as is shown in the documentation.
buildscript {
repositories {
google() // <== CHANGED
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google() // <= CHANGED
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven { url "https://dl.bintray.com/krazykira/maven" }
}
}

Categories

Resources