"Failed to resolve: com.android.support:support-v4:26.0.0" and other similar errors on Gradle sync [duplicate]
I don't have an Android wear project, but I had the same problem when I wanted to upgrade the Support Library version for an existing project to 26.0.0. Since 26.0.0 the support libraries are available through Google's Maven repository. So I had to add the repository to my build. gradle file.
allprojects { repositories { jcenter() maven { url "https://maven.google.com" } }}
Check out https://developer.android.com/topic/libraries/support-library/setup.html for more details.
The following worked for me:
In the Application build.gradle considered to add following:
allprojects {repositories { maven { url "https://maven.google.com" }}}
in the Module build.gradle:
compileSdkVersion 26buildToolsVersion "26.0.1"dependencies {compile fileTree(include: ['*.jar'], dir: 'libs')compile 'com.google.android.gms:play-services-wearable:11.0.4'compile 'com.android.support:support-compat:26.0.1'compile 'com.android.support:support-v4:26.0.1'compile 'com.google.android.gms:play-services:11.0.4'compile 'com.android.support:appcompat-v7:26.0.1'compile 'com.android.support:multidex:1.0.1'compile 'com.android.support:support-annotations:26.0.1'compile 'com.android.support:support-vector-drawable:26.0.1'compile 'com.android.support:animated-vector-drawable:26.0.1'compile 'com.android.support:design:26.0.1'compile 'com.android.support:support-v13:26.0.1'compile 'com.android.support:percent:26.0.1'compile 'com.android.support:wear:26.0.1'compile 'com.google.android.support:wearable:2.0.4'provided 'com.google.android.wearable:wearable:2.0.4'}
Either change your build tool version from 26.0.1
to 26.0.0
or you can replace 26.0.0
by 26.+
like below.
compile 'com.android.support:support-v4:26.0.0'
to
compile 'com.android.support:support-v4:26.+"
Do same with all...Hope it helps. Happy Coding! ^_^