‘Could not resolve com.google.gms:google-services:4.3.8’

Solution for ‘Could not resolve com.google.gms:google-services:4.3.8’
is Given Below:

I am trying to create my app using firebase so I have read their docs and did what they said.
This project is fresh react-native project. I didn’t change a letter from the initial react native template.

I downloaded google-services.json and paste it in android/app
Then I added “apply plugin: ‘com.google.gms.google-services'” this line at the end of android/app/build.gradle

Then I added “classpath ‘com.google.gms:google-services:4.3.8′” in dependencies at android/build.gradle

  • What went wrong:
    A problem occurred configuring root project ‘ludob’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not resolve com.google.gms:google-services:4.3.8.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.8.
> Could not get resource ‘https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.8/google-services-4.3.8.pom’.
> Could not GET ‘https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.8/google-services-4.3.8.pom’.
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

When I am running npm run android this problem is showing.