Saeed Entezari
Saeed Entezari

Reputation: 3755

Play services ads identifier is not found

In my Ubuntu OS I am adding play-services-ads-identifier to android studio build.gradle like this:

implementation "com.google.android.gms:play-services-ads-identifier:17.0.0"

And it works fine. But In Windows OS when I add the exact same thing in dependencies it throws error and does not build. the message is like this:

Warning:project ':app': Unable to build Kotlin project configuration Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugImplementationDependenciesMetadata'. Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find play-services-ads-identifier.jar (com.google.android.gms:play-services-ads-identifier:17.0.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-ads-identifier/17.0.0/play-services-ads-identifier-17.0.0.jar

Upvotes: 2

Views: 4022

Answers (2)

mahdi
mahdi

Reputation: 16407

i had same problem . it was solved with update gradle and android studio.

Upvotes: 1

Saeed Entezari
Saeed Entezari

Reputation: 3755

After carefully reading the error message I noticed that Gradle is looking for the jar file as it is provided by the link in the error message:

https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-ads-identifier/17.0.0/play-services-ads-identifier-17.0.0.jar

So I changed the dependency to this:

implementation "com.google.android.gms:play-services-ads-identifier:17.0.0@aar"

And it is working and building now. Hope it helps someone.

Upvotes: 4

Related Questions