0
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.it.munchies"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        useLibrary 'org.apache.http.legacy'
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.google.code.gson:gson:2.8.2'

    implementation 'com.facebook.android:facebook-android-sdk:4.8.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-places:17.0.0'
    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
    implementation files('libs/httpmime-4.2.1.jar')
    implementation 'me.leolin:ShortcutBadger:1.1.9@aar'
// routing
    implementation 'com.github.jd-alexander:library:1.0.7'
    implementation('io.socket:socket.io-client:0.8.3') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
}

// For FCM
apply plugin: 'com.google.gms.google-services'

when i updated android studio i had this error :

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:18:5-91:19 to override.

i've this error too but in gradle file ::::

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 23.0.1. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-v4:23.0.1 more... (Ctrl+F1
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • open and follow this link, you'll get your answer [https://stackoverflow.com/a/56667177/10340422](https://stackoverflow.com/a/56667177/10340422) – Chirag Rayani Jun 21 '19 at 08:20
  • And https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification – Zoe Jun 22 '19 at 10:58

1 Answers1

1

You are using both support libraries and androidx libraries and you can't do it.

Check the official release notes of Firebase Libraries:

-----------------------------------------------------------------
|  Service        |  Gradle dependency                           |
-----------------------------------------------------------------
| Firebase Core   | com.google.firebase:firebase-core:17.0.0     |
-----------------------------------------------------------------
| Cloud Messaging | com.google.firebase:firebase-messaging:19.0.0|
-----------------------------------------------------------------
| Authentication  | com.google.firebase:firebase-auth:18.0.0     |
-----------------------------------------------------------------

This release is a MAJOR version update and includes breaking changes. With this release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries. The updated libraries will not work unless you make the following changes in your app:

  • Upgrade com.android.tools.build:gradle to v3.2.1 or later.
  • Upgrade compileSdkVersion to 28 or later.
  • Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841