我坚持这个问题 -
Gradle sync failed:
Could not find com.google.android.gms:play-services-location:11.6.99.
我在google上搜索过但没有得到任何解决方案,昨天没有出现,但从今天上午开始,这是Gradle sync failed
问题。
当前版本 -
compile 'com.google.android.gms:play-services-location:11.6.0'
EDITED
Gradle文件 -
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply from: '../config/quality/quality.gradle'
//apply plugin: 'com.neenbedankt.android-apt'
android {
signingConfigs {
config {
keyAlias 'asdasd'
keyPassword 'asdasd'
storeFile file('/home/vikram/Documents/techvalens.keystore')
storePassword 'asasd'
}
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.tv.goin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 27
versionName "1.26"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [onesignal_app_id: "ID",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "NUM"]
}
buildTypes {
debug {
multiDexEnabled true
buildConfigField("String", "BASE_URL", "\"http://www.mocky.io/v2\"")
buildConfigField("String", "API_KEY", "\"ABCXYZ123TEST\"")
}
release {
minifyEnabled false
shrinkResources false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "BASE_URL", "\"http://www.mocky.io/v2\"")
buildConfigField("String", "API_KEY", "\"ABCXYZ123TEST\"")
}
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
buildToolsVersion '26.0.2'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// android support libraries
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
compile "com.android.support:design:$rootProject.supportLibraryVersion"
compile "com.android.support:support-vector-drawable:$rootProject.supportLibraryVersion"
compile "com.android.support:animated-vector-drawable:$rootProject.supportLibraryVersion"
//Sticky ScrollView
compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
//One signal Notification
compile 'com.onesignal:OneSignal:[3.6.5, 3.99.99]'
//Rating bar
compile 'com.iarcuschin:simpleratingbar:0.1.5'
//Crash
compile 'com.google.firebase:firebase-crash:11.6.0'
//Map
compile 'com.google.android.gms:play-services-maps:11.6.0'
//Auto Complete
compile 'com.google.android.gms:play-services-places:11.6.0'
//multidex
compile 'com.android.support:multidex:1.0.1'
//fb
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
// font
compile "uk.co.chrisjenx:calligraphy:$rootProject.calligraphyVersion"
// network
// compile "com.amitshekhar.android:rx2-android-networking:$rootProject.rx2FastAndroidNetworking"
// image
compile "com.github.bumptech.glide:glide:$rootProject.glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
// parser
compile "com.google.code.gson:gson:$rootProject.gsonVersion"
// database
compile "org.greenrobot:greendao:$rootProject.greenDaoVersion"
// debug database
debugCompile "com.amitshekhar.android:debug-db:$rootProject.debugDBVersion"
// dependency injection
compile "com.google.dagger:dagger:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
provided 'javax.annotation:jsr250-api:1.0'
compile 'javax.inject:javax.inject:1'
// reactive
compile "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
compile "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"
// code generator for view
compile "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"
// swipe view
compile 'com.tubb.smrv:swipemenu-recyclerview:5.4.0'
compile "com.mindorks:placeholderview:$rootProject.placeholderviewVersion"
// logger
compile "com.jakewharton.timber:timber:$rootProject.timberVersion"
// retrofit
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
//Date Picker
compile "com.wdullaer:materialdatetimepicker:$rootProject.datepickerVersion"
//Stripe Payment SDK
compile "com.stripe:stripe-android:$rootProject.stripeVersion"
//Qr scanner
compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2'
compile 'org.zakariya.stickyheaders:stickyheaders:0.7.6'
//Country code
compile 'com.hbb20:ccp:2.0.3'
// dependencies for local unit tests
testCompile "junit:junit:$rootProject.ext.junitVersion"
testCompile "org.mockito:mockito-core:$rootProject.mockitoVersion"
testAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
/*New*/
annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
//GLIDE CUSTOM
compile 'jp.wasabeef:glide-transformations:2.0.2'
//Picasso
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
//GMS
compile 'com.google.android.gms:play-services-location:11.6.0'
// compile 'com.google.android.gms:play-services-location:11.6.0'
//Seekbar
// compile 'com.crystal:crystalrangeseekbar:1.1.1'
compile 'com.crystal:crystalrangeseekbar:1.1.1'
//Carousel profile screen
compile 'com.azoft.carousellayoutmanager:carousel:1.2.1'
//Auto Scroll
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
//Swipe RecyclerView
compile 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'
//Expandable textview
compile 'at.blogc:expandabletextview:1.0.3'
//Firebase
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
//Image Cropper
compile 'com.naver.android.helloyako:imagecropview:1.2.0'
//Expandable RV
// compile project(':expandablerecyclerview')
compile project(path:':expandablerecyclerview',configuration: 'default')
/*
//Expandable RV
compile 'com.thoughtbot:expandablerecyclerview:1.3'
*/
//Underscore
compile 'com.github.javadev:underscore:1.28'
// compile 'com.lyft:scissors:1.1.1'
// Include all the Twitter APIs
compile 'com.twitter.sdk.android:twitter:3.1.1'
compile 'com.google.android.gms:play-services-auth:11.6.0'
//compile 'com.google.android.gms:play-services-auth:11.6.0'
/* //Double seekbar
compile 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-library:0.1.0'
*/
// UI Testing
androidTestCompile "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
androidTestCompile "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
androidTestCompile "org.mockito:mockito-core:$rootProject.mockitoVersion"
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
}
configurations.all {
resolutionStrategy.force "com.android.support:support-annotations:$supportLibraryVersion"
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
TOP级Gradle文件 -
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Add this line
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// Define versions in a single place
ext {
// Sdk and tools
minSdkVersion = 16
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = '26.0.0'
// App dependencies
supportLibraryVersion = '25.3.1'
gsonVersion = '2.8.0'
calligraphyVersion = '2.2.0'
glideVersion = '4.0.0'
rx2FastAndroidNetworking = '1.0.0'
// dagger2Version = '2.8'
dagger2Version = '2.11'
rxjava2Version = '2.0.6'
rxandroidVersion = '2.0.1'
butterKnifeVersion = '8.6.0'
greenDaoVersion = '3.2.0'
placeholderviewVersion = '0.6.1'
debugDBVersion = '1.0.0'
timberVersion = '4.5.1'
//Test dependencies
junitVersion = '4.12'
espressoVersion = '2.2.2'
mockitoVersion = '2.7.1'
//date Picker
datepickerVersion = '3.2.2'
//Stripe Payment SDK
stripeVersion = '4.1.5'
}
答案 0 :(得分:1)
顶级Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Add this line
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// Define versions in a single place
ext {
// Sdk and tools
minSdkVersion = 16
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = '26.0.0'
// App dependencies
supportLibraryVersion = '25.3.1'
gsonVersion = '2.8.0'
calligraphyVersion = '2.2.0'
glideVersion = '4.0.0'
rx2FastAndroidNetworking = '1.0.0'
// dagger2Version = '2.8'
dagger2Version = '2.11'
rxjava2Version = '2.0.6'
rxandroidVersion = '2.0.1'
butterKnifeVersion = '8.6.0'
greenDaoVersion = '3.2.0'
placeholderviewVersion = '0.6.1'
debugDBVersion = '1.0.0'
timberVersion = '4.5.1'
//Test dependencies
junitVersion = '4.12'
espressoVersion = '2.2.2'
mockitoVersion = '2.7.1'
//date Picker
datepickerVersion = '3.2.2'
//Stripe Payment SDK
stripeVersion = '4.1.5'
}
您可以从gradle构建文件中删除:
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.google.com' }
}
答案 1 :(得分:0)
将您的com.onesignal:OneSignal:[3.6.5, 3.99.99]
更改为com.onesignal:OneSignal:3.6.5
这就是我刚才解决的问题。