Мой проект вдруг не смог построить gradle.Происходит следующая ошибка:
Ошибка: не удалось устранить: play-services-basement
Вот мой build.grdle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
}
}
Когда я искал, было два решения:
добавить 101 jcenter{url "http://jcenter.bintray.com/"}
вместо jcenter()
переместить google()
до jcenter()
но ни один не работал.Что мне делать?
tnx
PS Я знаю, что мой вопрос похож на это и это , но решения не работают для меня.
обновление 1: приложение gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.my.app"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "0.7"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
google()
jcenter()
}
dependencies {
implementation 'com.android.support:recyclerview-v7:26.1.0'
// implementation 'com.google.firebase:firebase-core:16.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// compile 'im.crisp:crisp-sdk:0.1.10'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
compile 'com.stephentuso:welcome:1.4.1'
compile 'co.ronash.android:pushe-base:1.4.0'
compile 'com.google.android.gms:play-services-gcm:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
// compile 'com.google.firebase:firebase-auth:16.0.2'
compile 'com.google.android.gms:play-services-auth:15.0.1'
compile 'com.google.code.gson:gson:2.7'
compile('io.socket:socket.io-client:1.0.0') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
apply plugin: 'com.google.gms.google-services'
udpate2: проект gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}