Reputation: 401
I recently changed my desktop to a new one. Installed Android studio and pulled my project from remote. I have all the SDKs and SDK tools in the new android studio 3.5.1. But when I try to build project it fails at gradle sync. The error I get is:
ERROR: Failed to resolve: com.google.android.support:wearable:2.0.0
Show in Project Structure dialog
Affected Modules: wear
Here are some details that I think are important.
Android plug-in version: 2.3.3 (I have to use it) gradle version: 4.6
Inside gradle wrapper.properties I have this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
In my wear module build.gradle, i have this:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "A.B.C.D"
minSdkVersion 25
targetSdkVersion 28
versionCode 1252
versionName "1.2.52"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.google.android.wearable:wearable:2.0.0'
compile 'commons-io:commons-io:2.5'
compile 'com.crashlytics.sdk.android:crashlytics:2.10.1'
// compile "com.google.firebase:firebase-core:17.0.1"
// compile project(':library')
compile project(':XYZ')
}
apply plugin: 'com.google.gms.google-services'
I tried the following and none worked:
not sure what is going on but i am just not able to sync it. I am suspecting that the gradle is not properly downloaded and recognized by Android studio. Any leads are appreciated.
Upvotes: 0
Views: 876
Reputation: 344
case 1: gradle is not installed :-
you can download the wrapper and point to this in $projectroot/gradle/wrapper/gradle-wrapper.properties and just do ./gradlew and check what the error is coming, most probably the error may come due to proxy
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
case 2: gradle is already intalled:- just run the ./gradlew clean assemble in console and check the stacktrace.
Upvotes: 0