我無法同步Google Play Services
中的基本示例項目。我曾嘗試更新minsdk
,targetsdk
,compilesdk
版本,更新了項目結構和風味,但該項目仍不會sync
。未能在Android Studio中同步gradle項目
這是我的錯誤:
Error:Could not find method compile() for 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 the Android Support Repository from the Android SDK Manager.
<a href="openAndroidSdkManager">Open Android SDK Manager</a>
不過,我安裝了最新的Android Support Repository (rev 36)
,所以我認爲這個問題是另一回事。
如果你想嘗試和克隆項目:https://github.com/playgameservices/android-basic-samples.git
gradle
文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
/*
REPLACE THIS VALUE WITH YOUR 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()
}
}
當然,你做了其他的事情,因爲你所做的只是刪除一些字符串變量。 –
嗯...聽起來像是魔法?! – Tima
這是終點線!看到上面選擇的答案 – user2456977