Failed to resolve: com.afollestad:bridge:5.1.2 - android

I have Android Studio 3.2.1 and i having an issue syncing my project.
Error:
Failed to resolve: com.afollestad:bridge:5.1.2
Show in File
Show in Project Structure dialog
UPDATED:
the error also persists with android studio 3.4
And my gradles files are:
App:
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 {
lintOptions {
checkReleaseBuilds false
// abortOnError false
}
signingConfigs {
Signing_Release {
keyAlias project.keyAlias
keyPassword project.keyPassword
storeFile file(project.storeFile)
storePassword project.storePassword
}
}
compileSdkVersion 28
defaultConfig {
applicationId "XXXXXXXXXXXXXXXXXXXXXXXX"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "3.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
productFlavors {
app1 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 16
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app2 {
applicationId 'com.assertsoft.assertforms.centenarioseguridad'
buildConfigField "String", "URL_BASE", "\"https://centenarioseguridad.onfieldsystem.cl/rest/\""
versionCode 1
flavorDimensions "default"
}
app3 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 16
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app4 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 1
minSdkVersion 1
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app5 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 1
minSdkVersion 1
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
}
buildTypes {
debug {
buildConfigField "Boolean", "ANALYTICS_ENABLE", "false"
}
release {
buildConfigField "Boolean", "ANALYTICS_ENABLE", "true"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
ext {
playServicesVersion = '11.8.0'
retrofitVersion = '2.1.0'
mlVisionVersion = '18.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9#aar') {
transitive = true;
}
implementation project(':camara')
implementation 'androidx.multidex:multidex:2.0.1'
implementation('com.afollestad:bridge:5.1.2') {
exclude group: 'org.json', module: 'json'
}
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.jakewharton:butterknife:10.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.instacart.truetime-android:library:3.3'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.evernote:android-job:1.2.5'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.mcxiaoke.viewpagerindicator:library:2.4.1#aar'
implementation 'com.github.HotBitmapGG:RingProgressBar:V1.2.2'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.uncopt:android.justified:1.0'
implementation 'com.valdesekamdem.library:md-toast:0.9.0'
implementation 'io.realm:android-adapters:2.1.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.grappes:Infinix-Indicator:1.0.2'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.savvi.datepicker:rangepicker:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.uphyca:stetho_realm:2.3.0'
implementation 'com.github.takusemba:spotlight:1.6.1'
// implementation "com.google.firebase:firebase-ml-vision:$mlVisionVersion"
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.robertlevonyan.view:MaterialChipView:1.2.5'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
// TESTING
testImplementation 'junit:junit:4.12'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
Project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//jcenter()
google()
jcenter({url "http://jcenter.bintray.com/"})
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "io.realm:realm-gradle-plugin:5.2.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 {
//jcenter()
jcenter({url "http://jcenter.bintray.com/"})
mavenCentral()
maven { url 'https://github.com/WickeDev/stetho-realm/raw/master/maven-repo' }
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/dgunjit14/Infinix-Indicator" }
google()
}
// Workaround for https://issuetracker.google.com/117900475
// Remove when upgrading to AGP 3.4 or higher.
configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
config.resolutionStrategy.eachDependency { details ->
details.useVersion("3.5.0-alpha03-5252756")
}
}
}
project.ext {
keyAlias = 'xxxxxxxx'
keyPassword = 'xxxxxxxx'
storeFile = 'xxxxxx.jks'
storePassword = 'xxxxxxxxxxx'
}
task clean(type: Delete) {
delete rootProject.buildDir
}

This library is no longer available. You can download JAR here: https://mvnrepository.com/artifact/com.afollestad/bridge/5.1.2
You should migrate to another solution as soon as possible.

Related

Android :app:processReleaseResources Android resource linking failed

I am getting this error while running the app.
Here are the Gradle files for my project.
build.gradle
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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
}
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
signingConfigs {
'release' {
storeFile file('/Users/jeetraval/Documents/Workspace/my-audio-app-android/test.jks')
keyAlias 'key0'
storePassword 'Test#123'
keyPassword 'Test#123'
}
}
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.jeet.myaudio"
minSdkVersion 25
targetSdkVersion 31
versionCode 5
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
signingConfig signingConfigs.release
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
/*applicationVariants.all { variant ->
renameAPK(variant)
}*/
}
}
dataBinding {
enabled = true
}
dexOptions {
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "default"
productFlavors {
prod {
versionName "1.0.3"
resValue "string", "app_name", "MyAudio"
}
}
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.4.1'
//noinspection GradleCompatible
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
//noinspection GradleCompatible
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'cn.carbs.android:AvatarImageView:1.0.4'
// testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
// androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-ads:20.6.0'
// Room
implementation 'androidx.room:room-runtime:2.2.2'
kapt 'androidx.room:room-compiler:2.2.2'
kapt "com.android.databinding:compiler:3.1.4"
// Test helpers for Room
testImplementation 'androidx.room:room-testing:2.2.2'
implementation 'com.kovacorp.vocalizesdk:VocalizeSDK:0.0.7'
implementation "com.google.assistant.appactions:suggestions:1.0.0"
}
The distribution URL which I used in gradle-wrapper.properties is as follows:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
I have checked all the res files. But there is no error in any files. Please suggest any approach to solve this. Thanks in advance.

Could not get unknown property 'url' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

I'm trying to make project from Git hub,after importing it worked well.But now in my other project using same code a gradle sync error is coming:
Could not get unknown property 'url' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension
My app level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.sauravsaidevwhats.whatsappstatussaver"
minSdkVersion 21
targetSdkVersion 29
versionCode 7
versionName "1.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.each {
it.buildConfigField 'String', 'url', url
it.buildConfigField 'String', 'url_second', url_second
it.buildConfigField 'String', 'downloadUrl', downloadUrl
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'
implementation 'commons-io:commons-io:2.4'
implementation 'com.google.android.exoplayer:exoplayer:2.11.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.karumi:dexter:6.0.2'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
implementation 'org.jetbrains:annotations:15.0'
}
Module Gradle
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/drummer-aidan/maven' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You have to set Api configurations in gradle properties as well. Hope it will solve the problem.
Go to your gradle.properties and create a line with your api. Example:
Myapitoken=a9s87d9a798fd79f7d96

Androidx :ERROR: Failed to resolve: legacy-support-core-utils

i got this error when trying to migrate my android app to androidX
with this implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.0'
but it's ok with :
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v7:0.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
this build.gradle class
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "net.healthintouch.hit"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.013"
multiDexEnabled true
testInstrumentationRunner "android.support.register.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
def baseUrl
release {
baseUrl = '\"http://healthintouch.me/"'
buildConfigField 'String', 'BASE_URL', baseUrl
resValue "string", "BASE_URL", "healthintouch.me"
buildConfigField 'Boolean', 'enableCrashlytics', 'true'
debuggable false
minifyEnabled true
shrinkResources true
// useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
baseUrl = '\"http://192.168.1.3/"'
buildConfigField 'String', 'BASE_URL', baseUrl
resValue "string", "BASE_URL", "healthintouch.me"
debuggable true
ext.enableCrashlytics = false
minifyEnabled false
shrinkResources false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'androidx.core:core:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.1.0-alpha07'
// implementation 'androidx.cardview:cardview:1.0.0-rc02'
// implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.databinding:databinding-adapters:3.6.0-alpha02'
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0-alpha01'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'br.com.mauker.materialsearchview:materialsearchview:1.2.3'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'com.google.android:flexbox:1.0.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.arabiaweather:arabic-time-sense:1.0.1'
implementation 'com.github.mthli:Knife:v1.1'
implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'
implementation 'com.github.PierfrancescoSoffritti:AndroidYouTubePlayer:7.0.1'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.2'
implementation 'org.jsoup:jsoup:1.8.3'
implementation 'com.leocardz:link-preview:2.0.0#aar'
// implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.5.0-beta.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v7:0.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
implementation 'com.danikula:videocache:2.7.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation "com.daimajia.swipelayout:library:1.2.0#aar"
implementation 'com.codesgood:justifiedtextview:1.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation group: 'com.github.michaelgantman', name: 'MgntUtils', version: '1.5.0.3'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and this is buid.gradle
buildscript {
repositories {
maven { url 'https://maven.google.com' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
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 {
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy'}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
any answer ?
I had this problem, so I upgrade the Gradle plugin version then solved.

Execution failed for task ':app: lintVitalRelease' due to `Could not find multidex-instrumentation.aar`

When I try to sync my app module inside android studio it prompts error:
ERROR: Failed to resolve: multidex-instrumentation Affected Modules:
app
When I try to run gradlew assemble
Execution failed for task ':app:lintVitalRelease'.
Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath'.
Could not find multidex-instrumentation.aar (androidx.multidex:multidex-instrumentation:2.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/multidex/multidex-instrumentation/2.0.0/multidex-instrumentation-2.0.0.aar
solutions listed in this question did not fix my issue.
And an strange thing is that nothing as multidex-instrumentation-2.0.0 does not exist and I don't know why my app looks for such dependency.
Multidex-instrumentation 2.0.0 exists in Maven Repository.
Here are my build.gradle and app.gradle:
app.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 {
google()
jcenter()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
}
android {
// flavorDimensions ("resrouce")
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions{
disable 'MissingTranslation'
// checkReleaseBuilds false
// abortOnError false
}
defaultConfig {
applicationId 'com.myapp.android'
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName '1.0'
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = true
}
releaseNonObfuscated {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = false
}
debug {
versionNameSuffix '-DEBUG'
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "enableCrashlytics", "true"
ext.enableCrashlytics = true
}
}
dexOptions {
javaMaxHeapSize "2g"
}
sourceSets {
main {
res.srcDirs = [
'src/main/res',
'src/main/res/layout',
'src/main/res/layouts/product',
'src/myapp_eve/res'
]
}
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
}
ext {
//support_library_version = '28.0.0'
smooch_chat_librar_version = '5.16.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.android.support:28.0.0'
// implementation 'com.android.support:support-fragment:28.0.0'
// implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
// implementation 'com.android.support:collections:28.0.0'
// implementation 'com.android.support:versionedparcelable:28.0.0'
// implementation 'com.android.support:collections:28.0.0'
// implementation 'de.greenrobot:eventbus:2.4.0'
// implementation 'org.roboguice:roboguice:3.0.1'
// compileOnly 'org.roboguice:roboblender:4.0.0'
// annotationProcessor 'org.roboguice:roboblender:4.0.0'
// implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
// compile 'com.paypal.sdk:paypal-android-sdk:2.12.4'
// compile 'com.braintreepayments.api:braintree:2.3.9'
// compile 'com.braintreepayments.api:drop-in:2.3.8'
// implementation 'com.facebook.android:facebook-android-sdk:4.23.+'
//implementation 'org.roboguice:roboblender:4.0.0'
// implementation 'com.jakewharton:butterknife:10.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.core:core:1.1.0-alpha05'
implementation 'androidx.annotation:annotation:1.1.0-beta01'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.rey5137:material:1.2.5'
implementation 'com.pnikosis:materialish-progress:1.5'
// implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.commonsware.cwac:merge:1.1.2'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
implementation 'com.github.markomilos:paginate:0.5.1'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.malinskiy:superrecyclerview:1.1.1'
implementation 'com.daimajia.swipelayout:library:1.2.0#aar'
implementation 'com.flipboard:bottomsheet-core:1.5.0'
implementation 'com.flipboard:bottomsheet-commons:1.5.0'
implementation 'org.apmem.tools:layouts:1.10#aar'
implementation(name: 'persiandatepicker-release', ext: 'aar')
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.8#aar') {
transitive = true;
}
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.binjar.prefsdroid:prefs-droid:1.1.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.google.inject:guice:4.2.2'
implementation "io.smooch:core:${smooch_chat_librar_version}"
implementation "io.smooch:ui:${smooch_chat_librar_version}"
}
apply plugin: 'com.google.gms.google-services'
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
}
dependencies {
//vahhab change to 3.2.0
classpath 'com.android.tools.build:gradle:3.3.1'
//classpath 'com.android.tools.build:gradle:3.2.1'
//classpath 'com.google.gms:google-services:2.0.0-alpha3'
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
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
flatDir { dirs 'libs' }
}
}
You should enable jetifier in the gradle.properties file.
android.enableJetifier=true
delete .gradle and .idea folders then rebuild the project.

Duplicate classes when building in Android Studio

i am getting an error when building an Android Studio project.
Program type already present: com.google.android.gms.internal.measurement.zzdz
here is my build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'io.fabric'
apply plugin: 'com.getkeepsafe.dexcount'
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2'
classpath 'com.google.gms:google-services:3.2.1'
}
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 202
versionName "2.0.0"
buildConfigField "boolean", "CRASHLYTICS_ENABLED", "false"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
flavorDimensions "type", "name"
productFlavors {
magazines {
dimension "type"
}
magazine {
dimension "name"
// Remove next line to enable Crashlytics and change false to true in second line
ext.enableCrashlytics = false
buildConfigField "boolean", "CRASHLYTICS_ENABLED", "false"
}
wind {
dimension "name"
// Remove next line to enable Crashlytics and change false to true in second line
ext.enableCrashlytics = false
buildConfigField "boolean", "CRASHLYTICS_ENABLED", "false"
}
script {
//// Use custom gradle file if it exists in script product flavor folder
if (new File("./main/src/script/custom.gradle").exists()) {
println 'custom.gradle script exists'
apply from: "../main/src/script/custom.gradle";
} else {
throw new GradleException('No custom.gradle script exists')
}
//applicationId scriptApplicationId
dimension "name"
buildConfigField "boolean", "CRASHLYTICS_ENABLED", "true"
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}
dependencies {
implementation fileTree(include: '*.jar', dir: 'libs')
//added here
implementation fileTree(include: '*.java', dir: 'libs')
implementation fileTree(include: '*.so', dir: 'libs')
//til here
implementation project(':appiraterAndroid')
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'commons-io:commons-io:2.4'
implementation 'io.reactivex:rxandroid:0.24.0'
implementation 'uk.co.chrisjenx:calligraphy:2.1.0'
implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'
implementation 'com.github.castorflex.smoothprogressbar:library-circular:1.1.0'
implementation 'com.anjlab.android.iab.v3:library:1.0.26#aar'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'net.danlew:android.joda:2.8.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.4.0#aar') {
transitive = true;
}
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-core-utils:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation('com.github.afollestad.material-dialogs:core:0.8.5.5#aar') {
transitive = true
}
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.5'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation "com.google.android.gms:play-services-base:16.0.1"
}
apply plugin: 'com.google.gms.google-services'
i am sure that there is something to do with dependencies and versions , but i can't find out.
i tried to clean gradle cache and restarting Android studio , but i am still getting the error above.
Migrate project to androidx support
Click -> Refactor -> Migrate to AndroidX
and update the libraries

Categories

Resources