Error: Cause: compileSdkVersion is not specified after install plugin - android

I tried to install this plugin. firstly i got
Can not add task 'clean' as a task with that name already exists.
then I fixed it by commented this lines
//
//task clean(type: Delete) {
// delete rootProject.buildDir
//}
in the build.gradle (Project:XXX)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.github.stephanenicolas.ormgap:ormgap-plugin:1.0.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'com.android.application'
apply plugin: 'ormgap'
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
//
//task clean(type: Delete) {
// delete rootProject.buildDir
//}
then I got error
Cause: compileSdkVersion is not specified.
even thoght it's already specified in build.gradle file
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "www.pro_cs_is.com"
minSdkVersion 15
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'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
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',{
exclude group: 'com.google.code.findbugs'})
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.google.apis:google-api-services-blogger:v3-rev57-1.23.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.j256.ormlite:ormlite-android:5.1'
implementation 'com.j256.ormlite:ormlite-core:5.1'
}

apply plugins in
build.gradle(module:app) only
As follows
apply plugin: 'com.android.application'
apply plugin: 'ormgap'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "www.pro_cs_is.com"
minSdkVersion 15
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'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
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',{
exclude group: 'com.google.code.findbugs'})
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.google.apis:google-api-services-blogger:v3-rev57-1.23.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.j256.ormlite:ormlite-android:5.1'
implementation 'com.j256.ormlite:ormlite-core:5.1'
}
and remove it from build.gradle(project:XXX)
I hope this will be help

Related

com.google.android.gms.internal.measurement.zzdf error in android

When I migrated project to android-x I got error this Program type already present:android.support.v4.media.MediaBrowserCompat$ConnectionCallback$ConnectionCallbackInternal I've googled some and ended up on the developer page about "Resolve duplicate class errors", but I'm still not able to fix this. I added this in my gradle.properties android.useAndroidX = true
android.enableJetifier = false but it doesn't solve myy problem Help would be very much appriciated! ,how can I solve this problem?
build.gradle(project)
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://maven.fabric.io/public'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.31.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.orin.music"
minSdkVersion 16
targetSdkVersion 28
versionCode 16
versionName '1.4'
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
dexOptions {
jumboMode true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.chrisbanes.photoview:library:1.2.3'
implementation 'com.facebook.android:facebook-android-sdk:4.35.0'
implementation 'com.pkmmte.view:circularimageview:1.1'
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
implementation 'androidx.mediarouter:mediarouter:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-ads:19.2.0'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-ads:19.2.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
//implementation 'com.android.support:support-emoji-appcompat:28.0.0'
//implementation "com.android.support:support-emoji:28.0.0"
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
apply plugin: 'com.google.gms.google-services'
project gradle.build
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and app gradle.build
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.orin.music"
minSdkVersion 16
targetSdkVersion 28
versionCode 16
versionName '1.4'
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
dexOptions {
jumboMode true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.chrisbanes.photoview:library:1.2.3'
implementation 'com.facebook.android:facebook-android-sdk:4.35.0'
implementation 'com.pkmmte.view:circularimageview:1.1'
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.mediarouter:mediarouter:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-ads:19.2.0'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-ads:19.2.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
all these libraries are outdated, and io.fabric is not required anymore by firebase and googl.gms. The plugins are old too.
During my test, I cannot load neither the io.fabric plugin 1.31.2

Latest firebase sdk will keep causing crash to app

I'm trying to add following dependencies in build.gradle -
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
But app will keep crashing with following message -
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/util/zzq;
If i'm going to remove firebase from here then the crash will go away. I have tried with firebase version 16.0.6 too but still it will keep crashing.
Following is my app level build.gradle -
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc02'
implementation 'com.android.support:support-v4:28.0.0-rc02'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'androidx.slice:slice-core:1.0.0-alpha1'
implementation 'androidx.slice:slice-builders:1.0.0-alpha1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Following is my project level build.gradle -
buildscript {
ext.kotlin_version = '1.2.60'
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-rc02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You should update your dependencies in app gradle file like:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
And project gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'io.fabric'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 22
targetSdkVersion 28
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
repositories {
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.slice:slice-core:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Hope this help you!
you'd have to add apply plugin: "com.google.gms.google-services" at the bottom of the module level's build.gradle (so that the values of google-services.json will be applied to the resources; this file can be downloaded from the Firebase console). most likely, you'd also have to add implementation "com.google.android.gms:play-services-base:16.1.0" to the dependencies, in order to provide that one missing class.
and there are also duplicate com.android.support vs. androidx dependencies; for example:
// implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
...even if it won't throw NoClassDefFoundError, there will be duplicates unless these are fixed. better first fully migrate to androidx and then try to fix the issue with Play Services; because while being right within the half-done process of refactoring, it is rather difficult to attribute an issue to something.

Program type already present in android support

When I try to run the application this error occurs:
Error:Program type already present:android.support.v4.os.ResultReceiver
I think that it is a dependency issue but I do not know how to solve this.
App level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.faisal.mychat"
minSdkVersion 15
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'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-v4:26.+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
Project level gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean
(type: Delete) {
delete rootProject.buildDir
}
At first add
implementation 'com.google.firebase:firebase-core:12.0.1'
Do not add dependency with + . Please try to use the same and specific version of the dependency for all.
For example
Instead of
implementation 'com.android.support:support-v4:26.+'
use
implementation 'com.android.support:support-v4:27.1.1'

After updating Gradle dependencies failed to resolve Firebase modules

I have updated my project to latest dependencies, also changed compile to implementations and gradle plugins and i have this error
Failed to resolve: firebase-analytics Open File
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-ads-identifier Open File
Failed to resolve: play-services-stats Open File
Failed to resolve: play-services-basement Open File
Module
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "my.id"
minSdkVersion 16
targetSdkVersion 28
versionCode 36
versionName "2.04"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
//multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
}
}
productFlavors {
}
}
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 files('libs/chartboost.jar')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.polok:clicknumberpicker:0.1.2'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-crash:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.android.billingclient:billing:1.0'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
Project
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
classpath "io.realm:realm-gradle-plugin:3.5.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Tried a lot of combinations, can someone help?

unable to merge dex. Tried everything still not working

I have tried with:
1)Clean and rebuild.
2)multiDexEnabled true.
But still the error shown is:Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Any suggestions how to fix it, please help ?
My app level gradle file:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
}
}
compileSdkVersion 27
defaultConfig {
applicationId "com.example.hp.facebook_login"
minSdkVersion 19
targetSdkVersion 27
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'
}
debug {
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.facebook.android:account-kit-sdk:4.33.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
My project level gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
//for Facebook SDK
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// 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
}
Adding these few lines helped remove the error successfully for me :
Here is the new app level gradle file, you can compare and find the changes.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.hp.mkchat"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.android.support:support-v4:27.1.1-beta1'
implementation 'com.google.firebase:firebase-database:11.4.2'
implementation 'com.google.firebase:firebase-storage:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
implementation 'com.firebaseui:firebase-ui-database:3.1.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.1"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
apply plugin: 'com.google.gms.google-services'

Categories

Resources