Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Gradle项目同步失败。基本功能(如编辑、调试)将无法正常工作_Android_Android Gradle Plugin_Google Play Services - Fatal编程技术网

Android Gradle项目同步失败。基本功能(如编辑、调试)将无法正常工作

Android Gradle项目同步失败。基本功能(如编辑、调试)将无法正常工作,android,android-gradle-plugin,google-play-services,Android,Android Gradle Plugin,Google Play Services,更新gradle和插件后 我很难建造 图书馆com.google.android.gms:play-services基地是由其他图书馆在[[11.0.1,11.0.1]]请求的,但最终决定为15.0.1。禁用插件并使用./gradlew:app:dependencies检查依赖关系树 我的格拉德尔: buildscript { repositories { jcenter() google() } dependencies { classpath 'com.an

更新gradle和插件后 我很难建造

图书馆com.google.android.gms:play-services基地是由其他图书馆在[[11.0.1,11.0.1]]请求的,但最终决定为15.0.1。禁用插件并使用./gradlew:app:dependencies检查依赖关系树

我的格拉德尔:

buildscript {
 repositories {
     jcenter()
     google()
 }
 dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath "io.realm:realm-gradle-plugin:3.1.1"
    classpath 'com.google.gms:google-services:4.0.1'
 }
}
我的应用程序/gradle

dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
    transitive = true
}

implementation 'com.facebook.android:account-kit-sdk:4.28.0'
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'

implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.4'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/glide-3.8.0.jar')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.squareup.okhttp:okhttp-urlconnection:2.3.0') {
    exclude group: 'com.squareup.okhttp', module: 'okhttp'
}
implementation('com.squareup.okhttp:okhttp:2.3.0') {
    exclude group: 'com.squareup.okio', module: 'okio'
}
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.android.support:exifinterface:27.1.1'

implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'

implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'

}
我解决了这个问题 这就是解决方案

1.add google() before jcenter() in gradle and app/gradle
2.exclude group:"com.google.android.gms" in facebook sdk dependencies
我的代码 格拉德尔:

buildscript {
repositories {
    google()
    jcenter()
}

// something here ...

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath "io.realm:realm-gradle-plugin:3.1.1"
    classpath 'com.google.gms:google-services:4.0.1'
}
}

allprojects {
repositories {
    google()
    jcenter()
}
}

task clean(type: Delete) {
   delete rootProject.buildDir
}
和Myapp/gradle:

repositories {
   maven { url 'https://maven.fabric.io/public' }
   google()
   jcenter()
}

dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
    transitive = true
}

implementation ('com.facebook.android:account-kit-sdk:4.28.0'){
    exclude group:"com.google.android.gms"
}
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'

implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.4'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/glide-3.8.0.jar')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.squareup.okhttp:okhttp-urlconnection:2.3.0') {
    exclude group: 'com.squareup.okhttp', module: 'okhttp'
}
implementation('com.squareup.okhttp:okhttp:2.3.0') {
    exclude group: 'com.squareup.okio', module: 'okio'
}
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.android.support:exifinterface:27.1.1'

implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'

implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'

}
apply plugin: 'com.google.gms.google-services'
这对我来说很好,希望能帮助你们