When using compile 'com.google.android.support:wearable:2.0.4' I get the error below, but I am not using 26.0.0

后端 未结 1 1949
谎友^
谎友^ 2021-01-15 00:45

When using compile \'com.google.android.support:wearable:2.0.4\' (the latest version of com.google.android.support:wearable) in my Wear app\'s buil

相关标签:
1条回答
  • 2021-01-15 01:04

    Many of the Wear elements (BoxInsetLayout, WearableRecyclerView, SwipeDismissFrameLayout, full list here) have been moved to the main android support library (details). You can continue to use the old classes, but you probably want to use the latest stuff.

    The build.gradle for your wear app includes compile 'com.google.android.support:wearable:2.0.4' which uses some classes from com.android.support:wear:26.0.0. As called out in link above, they were moved from com.google.android.support:wearable to com.android.support:wear.

    The support libraries (26) are now in Google's Maven repository (not downloaded via the support repository from the SDK Manager), so you need to add Google's Maven Repository your top level build.gradle file.

    In allprojects, within repositories, add the code below. It goes under the jcenter() call.

    For the Android Gradle plugin revision 2.3.3 with Gradle 3.3 (Android Studio 2.3.3), your code should look like this:

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

    For the Android Gradle plugin revision 3.0.0 (in alpha right now) with Gradle 4.1 (might be milestone version) in Android Studio 3.0.0, your code should look like this:

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    
    0 讨论(0)
提交回复
热议问题