Failed to sync gradle project in Android Studio -


i unable sync basic samples project google play services. have tried updating minsdk, targetsdk, compilesdk versions, updated project structure , flavors project still won't sync.

this error:

error:could not find method compile() arguments [com.android.support:support-v4:24.2.0] on defaultexternalmoduledependency{group='com.android.support', name='appcompat-v7', version='24.2.0', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.defaultexternalmoduledependency.  please install android support repository android sdk manager. <a href="openandroidsdkmanager">open android sdk manager</a> 

however installed latest android support repository (rev 36) assume issue else.

if want try , clone project: https://github.com/playgameservices/android-basic-samples.git

gradle file:

apply plugin: 'com.android.application'  android {     compilesdkversion 24     buildtoolsversion '24.0.1'     defaultconfig {          /*           replace value application id         */         applicationid "com.google.example.games.replace.me"          minsdkversion 19         targetsdkversion 24         versioncode 1         versionname "1.0"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt'         }     }     productflavors {     } }  dependencies {     compile "com.android.support:appcompat-v7:${appcompat_library_version}" compile "com.android.support:support-v4:${support_library_version}" compile project(':libraries:basegameutils') }  buildscript {     repositories {         jcenter()     } } 

the issue minor one: don't have end-lines after each dependency.

this

dependencies { compile "com.android.support:appcompat-v7:${appcompat_library_version}" compile "com.android.support:support-v4:${support_library_version}" compile project(':libraries:basegameutils') } 

should be

dependencies {     compile "com.android.support:appcompat-v7:${appcompat_library_version}"     compile "com.android.support:support-v4:${support_library_version}"     compile project(':libraries:basegameutils') } 

this error quite common when plugin on android studio edits or modifies gradle file in way when dependency uses variable instead of direct reference version number. instance, i've noticed happen me when using method counts plugin or firebase plugin.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -