MycroftAI/Mycroft-Android

Failed to resolve: com.google.android.wearable:wearable:2.0.0

Closed this issue · 5 comments

I am seeing the following error both on master and v18.09-beta when importing a new Android studio project and attempting a Gradle sync.

Failed to resolve: com.google.android.wearable:wearable:2.0.0

Working to resolve now, going to log progress here in case anyone else sees the same issue.

I was able to resolve this by using the maven google repository rather than google() in build.gradle.

https://stackoverflow.com/questions/45496409/when-using-compile-com-google-android-supportwearable2-0-4-i-get-the-error-b

I replaced all occurrences of google() with the below in build.gradle. I am not sure why this works for me, since I don't use gradle very often, and the above StackOverflow question is the only thing I have to go on. I am raising a PR, but please feel free to reject it if my solution is naive.

    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }

Here is my Android studio information, in case it helps.

Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Okay, I had to upgrade the versions of a few upstream libraries before I could get a successful build which will start up on my Samsung Galaxy S9.

I'm raising a PR, but I am unable to test the Android wear project properly, as I don't own an Android wear device.

google() is just a shortcut for the longer maven configuration you added in its place. It's been available in Gradle-4.x for quite a while now.

The gradle wrapper was recently upgraded, could you confirm your gradle wrapper settings in Android Studio? What happens if you build from the command line?

Works out of the box now! Closing. Thanks for the support and for explaining the gradle version issues. :-)