Failed to update Firebase dependency (com.google.firebase)

I added Firebase to the Android app for push notifications. I updated build.gradle before using. It works great.

compile 'com.google.firebase:firebase-messaging:9.2.0' 

Now I upgraded to the latest library, but got an error.

  dependencies { //.... compile 'com.google.firebase:firebase-core:10.0.1' } 

I had an error during the Rebuild project

Error: There was a problem setting up the project: app. Failed to resolve all dependencies for configuration: app: _debugApkCopy. Could not find com.google.firebase: firebase-core: 10.0.1. Requires: DGApp: Application: Undefined

Thanks in advance.

+8
android android-studio firebase-cloud-messaging
source share
6 answers

You need to update your Google Play services and Google repository from the standalone SDK manager.

First open Android Studio and click this icon on the top toolbar:

Picture

Then, when the dialog box starts, click on “Launch Offline SDK Manager” at the bottom left of the dialog box:

image

To make sure that nothing but what we want is updated / installed, click "Cancel All":

Picture

When the Standalone SDK Manager window opens, find "Extras" and collapse it. You should see "Google Play Services" and "Google Repository", and on the right you will see "Available Update: {something}". Select them for the items and click Install.

Picture

When they are completed, the error will disappear.

+20
source share

Add google-services plugin

In the build.gradle file, include the google-services plugin:

 buildscript { // ... dependencies { // ... classpath 'com.google.gms:google-services:3.0.0' } } 

Then in your Gradle file (usually the application /build.gradle) add the line of the application plugin at the bottom of the file to enable the Gradle plugin:

 apply plugin: 'com.android.application' android { // ... } dependencies { // ... compile 'com.google.firebase:firebase-core:10.0.1' // Getting a "Could not find" error? Make sure you have // the latest Google Repository in the Android SDK manager } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services' 

See Firebase setup for more details.

+4
source share

If you read the documentation, they indicate that you are updating your latest Google Repository in the Android SDK manager

So go to the Android SDK Manager and install the latest version of below two libraries

1-Google Play Services

2-Google Repository

Check the image from the documentation:

enter image description here

+2
source share

Getting a Failed to Find Error? Make sure you have the latest Google repository in the Android SDK manager.

To solve the problem,

  • Open the SDK Manager and update the SDK tools for the latter, especially the Google API, for Android 7.0 (API 24).
0
source share

I just got it working with the Android Studio SDK Manager.

Just like other users suggest using a standalone tool, but no luck

0
source share

Maybe you are not giving the right repo.

 repositories { maven { url 'https://maven.fabric.io/public' } } 
} >
-2
source share

All Articles