I have a strange issue when integrate firebase
:

- 11,597
- 3
- 24
- 39

- 217
- 1
- 2
- 3
-
Welcome to Stack Overflow! [Please don't post your code as an image.](//meta.stackoverflow.com/q/285551) – rene Apr 14 '18 at 20:04
-
1Please include the content of your gradle files. Most likely you didn't include the google repository as stated here: https://stackoverflow.com/questions/45692460/failed-to-resolve-com-google-android-gmsplay-services-in-intellij-idea-with-gr – Alexander Hoffmann Apr 14 '18 at 21:54
6 Answers
if you integrate firebase automatically from tools, The new version of android studio have strange bug, the software inserts
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
instead of
implementation 'com.google.firebase:firebase-database:16.0.1'
fix this line (remove numbers after last ':')

- 1,411
- 13
- 15
-
3I followed this step but it doesn't confirm that cloud storage is added to the app? – CoderGirl94 Nov 14 '18 at 12:51
-
3Very much thanks, I wasted a day for this... I don't understand why google is doing such junk buggy releases... – kAmol Nov 29 '18 at 14:15
Remove the
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
and add only
implementation 'com.google.firebase:firebase-database:16.0.1'
Because
16.0.1
is added by our self and while after that we connect firebase using the plugin in the studio, it adds a new lib file with15.0.0
. So that's not required.

- 1,515
- 2
- 24
- 50
-
1
-
1because 16.0.15 is added by our self and while after that we connect firebase using the plugin in the studio, it adds new lib file with 15.0.0. so it not required – Subin Babu Oct 19 '18 at 04:58
Step 1 :
In your root build.gradle
file add the repo:
allprojects {
repositories {
google()
maven { url "https://maven.google.com" }
}
}
Now Sync Gradle. This is the directory that contains the repos of Firebase.
Step 2 :(if step 1 doesn't works)
If the Step 1 doesn't works, then it should be because you are using the Gradle in offline mode. If your gradle is set to offline, android studio searches for the cached copies of the dependencies that you want to update and throws an error since it hasn't downloaded the file before.
Go to Settings
>> Build, Execution, Deployment
>> Gradle
.
In the Global Gradle Settings
section, disable Offline
mode.
Now Sync Gradle again.

- 133
- 3
- 18

- 991
- 1
- 11
- 20
Use implementation com.google.firebase:firebase-database:16.0.1
as many wrote before. But also add the line: kapt com.google.firebase:firebase-database:16.0.1:15.0.0
this way firebase keep "Dependencies set up correctly".

- 33
- 4
after
implementation com.google.firebase:firebase-database:16.0.1
kapt 'com.google.firebase:firebase-database:16.0.1:15.0.0'
add the kapt, it fixed for me
-
CONFIGURE FAILED in 0s Could not find method kept() for arguments [com.google.firebase:firebase-database:16.0.1:15.0.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. – kAmol Dec 28 '18 at 16:26
Updated all the dependencies to
dependencies {
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
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'
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-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.5'
}
then build -> clean project, build -> rebuild project and is working

- 7,107
- 2
- 33
- 56

- 1
- 1