0

Hello fellow developer i'm new to Android Development I just want to know how to resolve this kind of problem because i need to connect my app to firebase.

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

    android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.acemergencyapp.user.aceapp"
    minSdkVersion 14
    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'
    }
}
    }

    dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.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.firebase:firebase-auth:16.0.1:15.0.0'
  }

I have a red line in implementation 'com.android.support:appcompat-v7:28.0.0'

Kenji
  • 11
  • 1
  • 8
  • Show the associated build or sync error as text in the question via an [edit]. A red underline in your IDE could be any number of things. Probably need to provide the top-level build.gradle, too, so we can see where you specify where to find dependencies. –  Sep 25 '18 at 19:42
  • The `implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'` line is added by the Firebase assistant, for those wondering what they did wrong. As the answers say, delete the `:16.0.0` at the end of the line. – Drazisil Oct 21 '18 at 13:56
  • https://stackoverflow.com/a/52612817/7147289 – Guy4444 Dec 03 '18 at 22:03

3 Answers3

2
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'

Remove this dependency (last line)

You have already included version 16.0.3 above

nupadhyaya
  • 1,909
  • 1
  • 14
  • 14
  • thank you so much the problem fix but i have problem my `implementation 'com.android.support:appcompat-v7:28.0.0'` have red line – Kenji Sep 25 '18 at 19:00
  • That is not an error, its a warning telling you that multiple versions of appcompat libraries are being used. Don't worry about it (for now, since you are new to android) – nupadhyaya Sep 25 '18 at 19:03
  • Ok sir copy that! You're a life savior thank you so much for your help . Sorry about the typo error im just newbie. i need to improve my skills! Thank you again! – Kenji Sep 25 '18 at 19:07
2

you have two version numbers there... obviously a copy & paste fail.

implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'

probably should rather be (which is already contained a few lines above):

implementation 'com.google.firebase:firebase-auth:16.0.3'

... maybe read your build.gradle, before posting your typos here.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • I remove it but `implementation 'com.android.support:appcompat-v7:28.0.0'` have red line what should i do? – Kenji Sep 25 '18 at 18:59
  • sorry about that sir im new to this i need more practice to see my errors – Kenji Sep 25 '18 at 19:02
  • @Kenji if you would add the error message to the question, I possibly could tell how to fix that... but I need the concrete error message for that. – Martin Zeitler Sep 25 '18 at 23:14
0

Solution:

Navigate to SDK Manager -> SDK Tools.

First, click the Android SDK Build-Tools and install the latest update.

Second, click the Android SDK Platform-Tools and install the latest update.

This should fix the red line.

(Alternatively suppose if it does not go try the below code)

Write this:

implementation 'com.android.support:support-v4:28.0.0'

or this:

implementation 'com.android.support:design:28.0.0'

Hope it helps.

Ümañg ßürmån
  • 9,695
  • 4
  • 24
  • 41