0

So I've created a google map activity and it was working. And everything went down after connecting the Firebase. I'm not sure what to post here but below is my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.tagpi.prototypev3"
        minSdkVersion 21
        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(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.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'
}

apply plugin: 'com.google.gms.google-services'

Can you guys teach me how this is fixed? I'm just starting to learn how to create a mobile app.

Thanks,

Agent Smith

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Agent Smith
  • 23
  • 1
  • 7
  • Possible duplicate of [Android gms.google.services version (15.0.1) conflict with Firebase Core 16.0.0](https://stackoverflow.com/questions/50780634/android-gms-google-services-version-15-0-1-conflict-with-firebase-core-16-0-0) – Jaydip Kalkani Jun 24 '18 at 04:20
  • try changing `play-services-maps` to `16.0.1` or vice versa. – ישו אוהב אותך Jun 24 '18 at 04:56
  • @ישואוהבאותך I tried changing that and i received this error 'Failed to resolve: com.google.android.gms:play-services-maps:16.0.1'. This play-services-maps is the default config when creating a new map activity – Agent Smith Jun 24 '18 at 06:31
  • @JaydipKalkani I'll check your link. Thanks for the reference btw – Agent Smith Jun 24 '18 at 06:33
  • @JaydipKalkani I have checked the link that you have provided. The Android Studio and SDK manager are all updated. The weird thing about this is that everything is working fine until I connected the firebase. I started out with a default Map Actvity and connected it to google. I've tested it and it is working without any issues. But after using the firebase assistant to connect to the database, everything is no longer working. – Agent Smith Jun 24 '18 at 07:01
  • @AgentSmith Kindly post your project level `build.gradle` file and also let me know which android studio version you are using? – Jaydip Kalkani Jun 24 '18 at 07:44

1 Answers1

0

You should use these.

implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-core:15.0.1'
Mbuodile Obiosio
  • 1,463
  • 1
  • 15
  • 19