solve error: cannot access Publisher in Android Studio? - android

I am getting this error while compilation of my code:
Can anyone help me how to solve this error or what might be causing this error?
Edit1: Gradle file of the project . And also the error log is attached with the question above.please check it.
import com.google.gms.googleservices.GoogleServicesPlugin
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.veblr.videomate"
minSdkVersion 21
targetSdkVersion 28
versionCode 16
versionName "1.0.0.8"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
aaptOptions.cruncherEnabled = true
aaptOptions.useNewCruncher = false
vectorDrawables.useSupportLibrary = true
resConfigs "en"
}
buildTypes {
debug {
jniDebuggable true
multiDexEnabled true
}
release {
minifyEnabled false
///shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
//Other parameters
debuggable false
jniDebuggable false
renderscriptDebuggable false
pseudoLocalesEnabled false
zipAlignEnabled true
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
ext {
roomVersion = '1.0.0'
archLifecycleVersion = '1.1.0'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/XXX'
exclude 'META-INF/license/LICENSE.base64.txt'
exclude 'META-INF/rxjava.properties'
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
jumboMode true
preDexLibraries = false
javaMaxHeapSize "12g" //specify the heap size for the dex process
}
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven{ url "https://adcolony.bintray.com/AdColony"}
maven { url 'https://maven.fabric.io/public'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.adcolony:sdk:3.3.0'
implementation 'com.google.ads.mediation:adcolony:3.2.1.1'
implementation 'com.google.android.material:material:1.0.0'
implementation "com.google.firebase:firebase-measurement-connector-
impl:17.0.5"
//noinspection GradleCompatible
implementation 'com.google.ads.mediation:facebook:4.27.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.27.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.danikula:videocache:2.7.0'
//noinspection GradleCompatible
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.2'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.0.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
implementation 'org.piwik.sdk:piwik-sdk:2.0.0'
implementation 'com.android.support:multidex:1.0.3'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.0'
// Room components
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
androidTestImplementation 'android.arch.persistence.room:compiler:1.1.1'
// Lifecycle components
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation "android.arch.lifecycle:viewmodel:1.1.1"
implementation 'android.arch.navigation:navigation-fragment:1.0.0-rc02'
implementation 'android.arch.navigation:navigation-ui:1.0.0-rc02'
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true
apply plugin: 'digital.wup.android-maven-publish'
I think there is some problem with the java compiler and java sdk if so ,please let me know if that's the problem and how to solve it .

Make sure in your project gradle buildscript you use latest version:
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
And also try to update version of your libraries use latest version:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.adcolony:sdk:3.3.0'
implementation 'com.google.ads.mediation:adcolony:3.2.1.1'
implementation 'com.google.android.material:material:1.0.0'
implementation "com.google.firebase:firebase-measurement-connector-impl:17.0.5"
//noinspection GradleCompatible
implementation 'com.google.ads.mediation:facebook:4.27.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.27.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.danikula:videocache:2.7.0'
//noinspection GradleCompatible
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.5'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
implementation 'org.piwik.sdk:piwik-sdk:2.0.0'
implementation 'com.android.support:multidex:1.0.3'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.0'
// Room components
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
androidTestImplementation 'android.arch.persistence.room:compiler:1.1.1'
// Lifecycle components
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation "android.arch.lifecycle:viewmodel:1.1.1"
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
implementation 'android.arch.navigation:navigation-ui:1.0.0'
}

Run it with --stacktrace or --info or --debug to see more log outputs information from the terminal for example: ./gradlew compileDebugJavaWithJavac --debug.
You wi be able to see more info on when and where it stopped the task and why it failed.

in my case the Publisher class was belong to the RxJava library which was missing from my project so adding these two lines in my app/gradle file fixed the problem:
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.x.x'

Try to update latest versions:
RxJava: io.reactivex.rxjava2:rxjava
RxAndroid: io.reactivex.rxjava2:rxandroid
Then, AndroidStudio -> File -> invalidate Cashes/Restart.
It helped me.

There is problem with 'com.google.firebase:firebase-core:16.0.8' library , when I upgraded it in app/gradle , it solved the problem for me.

Related

Error: Program type already present: org.xmlpull.v1.XmlPullParser

I'm getting this error when building a project, it seems that I have 2 libraries in my Gradle that are using the XML parser I tried to exclude it but it's not working.
Error: Program type already present: org.xmlpull.v1.XmlPullParser
Can anyone help me please in the right syntax for excluding the library?
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
compileSdkVersion 28
defaultConfig {
multiDexEnabled true
applicationId ''
minSdkVersion 19
targetSdkVersion 28
versionCode 4
versionName '4.0.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
def lastestMaterialDrawerRelease = '6.0.9'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/magtek-scra.jar')
implementation files('libs/univocity-parsers-2.6.3.jar')
implementation 'com.simplify:partner-sdk-android:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "com.android.support:appcompat-v7:$rootProject.supportVersion"
implementation "com.android.support:design:$rootProject.supportVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportVersion"
implementation "com.android.support.constraint:constraint-
layout:$rootProject.constraintLayoutVersion"
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'net.gotev:uploadservice:3.4.2'
implementation files('libs/mtscra.jar')
implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
implementation 'uk.co.samuelwall:material-tap-target-prompt:2.15.0'
implementation("com.mikepenz:materialdrawer:6.0.9#aar") {
transitive = true
}
implementation 'jp.wasabeef:blurry:3.0.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-config:16.5.0'
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
implementation 'com.github.AppIntro:AppIntro:4.2.3'
implementation 'com.github.deano2390:MaterialShowcaseView:1.3.4'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'org.jsoup:jsoup:1.12.1'
}
apply plugin: 'com.google.gms.google-services'

Error: Program type already present: com.google.firebase.analytics.FirebaseAnalytics$Event

The error persists when i try to build my code. I have already provided latest versions for all the implementations. Also i haven't used Analytics tool of firebase, but why is this error occurring ?
I have been updating the versions of the implementations one by one to mitigate several errors of such kinds.
my app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.ayushadarsh.odolog"
minSdkVersion 22
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'
}
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
//implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design: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.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-auth:16.2.1'
//noinspection UseOfBundledGooglePlayServices
implementation "com.google.android.gms:play-services:12.0.1"
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
implementation 'com.google.firebase:firebase-ml-vision:19.0.3'
}
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
This needs to be changed/updated to play-services-base:16.1.0 (which is not bundled):
//noinspection UseOfBundledGooglePlayServices
implementation "com.google.android.gms:play-services:12.0.1"
And remove this line; simply because painting the problem does not solve the problem:
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Libraries com.android.support:appcompat-v7:28.0.0 & com.android.support:cardview-v7:28.0.0 are also added twice. and this one plugin belongs to the bottom of the build.gradle:
apply plugin: "com.google.gms.google-services"
... this fixes the build:
dependencies {
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation "com.android.support:exifinterface:28.0.0"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
implementation "com.google.firebase:firebase-core:16.0.8"
implementation "com.google.firebase:firebase-auth:16.2.1"
implementation "com.google.firebase:firebase-database:16.1.0"
implementation "com.google.firebase:firebase-ml-vision:19.0.3"
implementation ("com.google.android.gms:play-services-base:16.1.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation ("com.google.android.gms:play-services-auth:16.0.1") {
exclude group: "com.android.support", module: "support-v4"
}
implementation ("com.theartofdev.edmodo:android-image-cropper:2.6.0") {
exclude group: "com.android.support", module: " exifinterface"
}
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"
Remove this
implementation 'com.google.android.gms:play-services:12.0.1'
change
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
to
apply plugin: 'com.google.gms.google-services'

Program type already present: com.google.android.gms.internal.measurement.zzfe

This is my error that i run on a mobile device and this is my Build. Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.medianova.doctorfinder"
minSdkVersion 17
targetSdkVersion 27
multiDexEnabled true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.facebook.android:facebook-login:4.37.0'
api 'com.facebook.android:facebook-share:4.37.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/httpclient-android-4.3.5.1.jar')
implementation 'com.github.yesidlazaro:GmailBackground:1.2.0'
implementation files('libs/httpmime-4.3.5.jar')
//database
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
}
apply plugin: 'com.google.gms.google-services'
I searched a lot but I don't have any solution about this issue.
I use android studio 3.1.0 and Gradle 4.4.
I also this error shown at the bottom of build tab.
MultiDex error is indicated when i run on mobile device.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
it builds with these versions:
dependencies {
implementation "com.android.support:multidex:1.0.3"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:customtabs:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation ("com.google.firebase:firebase-messaging:17.3.4") {
exclude group: "com.android.support", module:"support-v4"
}
implementation "com.google.firebase:firebase-core:16.0.7"
implementation "com.firebase:firebase-jobdispatcher:0.8.5"
implementation "com.android.volley:volley:1.1.1"
implementation ("com.squareup.picasso:picasso:2.71828") {
exclude group: "com.android.support"
}
implementation ("com.google.android.gms:play-services-ads:17.1.3") {
exclude group: "com.android.support"
}
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.google.android.gms:play-services-analytics:16.0.7"
implementation "com.google.android.gms:play-services-maps:16.1.0"
}
also see Migrating from Firebase JobDispatcher to WorkManager ...

Dynamsoft Android SDK clashes with okhttp3

I am working in a company project and there is a requirement to integrate Dynamsoft Android SDK for document scanning purpose. This problem is, when the sdk dependency is added to the current project, it get clashes with okhttp3 while giving this error on Build-console :
**Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Program type already present: okhttp3.Address
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.**
As it suggests in Developer console, okhttp3 has been excluded(actually tried in manifold ways) from Dynamsoft dependency yet problem remains.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
buildToolsVersion "28.0.2"
compileSdkVersion 28
defaultConfig {
applicationId "no.aspit.capture"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
dev {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'okhttp3/internal/publicsuffix/publicsuffixes.gz'
}
}
kotlin {
experimental {
coroutines 'enable'
}
}
androidExtensions {
experimental = true
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0-rc02'
implementation 'androidx.core:core-ktx:1.0.0-rc02'
implementation "android.arch.work:work-runtime-ktx:1.0.0-alpha08"
implementation 'androidx.preference:preference:1.0.0-rc02'
implementation 'androidx.fragment:fragment-ktx:1.0.0-rc02'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.moshi:moshi-kotlin:1.6.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'
//noinspection GradleCompatible
implementation "com.android.support:design:26.1.0"
implementation 'com.squareup.picasso:picasso:2.71828'
//Joda time
implementation 'net.danlew:android.joda:2.9.9.4'
// Image Compression
implementation 'id.zelory:compressor:2.1.0'
//Stetho
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
//Dynumsoft
implementation ('com.dynamsoft:dynamsoftcamerasdk:2.0#aar'){
exclude group: 'com.squareup.okhttp3'
}
}
repositories {
maven {
url "http://download.dynamsoft.com/maven/dcs"
}
You can try to solve the conflicts as follows:
configurations.all {
all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
all*.exclude group: 'com.squareup.okio', module: 'okio'
resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.10.0'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0-rc02'
implementation 'androidx.core:core-ktx:1.0.0-rc02'
implementation "android.arch.work:work-runtime-ktx:1.0.0-alpha08"
implementation 'androidx.preference:preference:1.0.0-rc02'
implementation 'androidx.fragment:fragment-ktx:1.0.0-rc02'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.moshi:moshi-kotlin:1.6.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.4.0'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'
//noinspection GradleCompatible
implementation "com.android.support:design:26.1.0"
implementation 'com.squareup.picasso:picasso:2.71828'
//Joda time
implementation 'net.danlew:android.joda:2.9.9.4'
// Image Compression
implementation 'id.zelory:compressor:2.1.0'
//Stetho
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
//Dynumsoft
implementation ('com.dynamsoft:dynamsoftcamerasdk:2.0#aar')
}

Android Studio 3.0 after rebuilding Duplicate zip entry warnings

After rebuiding my Java/Kotlin project I have got lot of warnings in Gradle console. How can I remove the warnings?
I try packagingOptions in my build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.eusecom.samfantozzi"
minSdkVersion 18
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'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE-FIREBASE.txt'
//duplicate files copied in apk meta-inf/rxjava
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/MANIFEST.MF'
exclude '1.jar:META-INF/MANIFEST.MF'
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation ('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
def daggerVer = 2.11
implementation "com.google.dagger:dagger:$daggerVer"
implementation "com.google.dagger:dagger-android-support:$daggerVer"
annotationProcessor "com.google.dagger:dagger-android-processor:$daggerVer"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVer"
//kotlin drawer
implementation 'co.zsmb:materialdrawer-kt:1.1.1'
//anko dsl
implementation "org.jetbrains.anko:anko-common:$anko_version"
compile "org.jetbrains.anko:anko-sdk15:$anko_version"
compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
compile "org.jetbrains.anko:anko-design:$anko_version"
compile "org.jetbrains.anko:anko-recyclerview-v7:$anko_version"
//Firebase
//Firebase Authentication email password
implementation 'com.google.firebase:firebase-auth:9.6.0'
//Firebase database
implementation 'com.firebaseui:firebase-ui-database:0.4.0'
implementation 'com.google.firebase:firebase-database:9.6.0'
//picasso
implementation 'com.squareup.picasso:picasso:2.5.0'
//retrofit2
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.3.1'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
//rxjava
implementation 'io.reactivex.rxjava2:rxjava:2.0.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex:rxandroid:1.2.0'
// libs like rxbinding + rxjava-math haven't been ported to RxJava 2.x yet, so this helps
implementation "com.github.akarnokd:rxjava2-interop:0.6.1"
implementation 'io.reactivex:rxjava-math:1.0.0'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
implementation 'com.jakewharton.rxbinding:rxbinding:0.2.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
In my project/build.gradle
buildscript {
ext.kotlin_version = '1.1.3-2'
ext.anko_version = '0.8.2'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
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
}
}

Categories

Resources