MycroftAI / Mycroft-Android

Android companion app, sends commands from your Android device to your Mycroft system and returns the output as speech or other medium to the Android device.
GNU General Public License v3.0
351 stars 130 forks source link

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

Closed kalexmills closed 5 years ago

kalexmills commented 5 years ago

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.

kalexmills commented 5 years ago

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"
        }
    }
kalexmills commented 5 years ago

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

kalexmills commented 5 years ago

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.

Sonderful commented 5 years ago

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?

kalexmills commented 5 years ago

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