Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.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
Java 错误:未能解析:com.google.girebase:firebase core:16.2.0_Java_Android_Gmsplacepicker - Fatal编程技术网

Java 错误:未能解析:com.google.girebase:firebase core:16.2.0

Java 错误:未能解析:com.google.girebase:firebase core:16.2.0,java,android,gmsplacepicker,Java,Android,Gmsplacepicker,我在添加GooglePlaces新库时出错 实现'com.google.android.libraries.places:places:1.1.0' 我尝试了所有这些解决方案 dependencies { compileOnly 'org.glassfish:javax.annotation:10.0-b28' implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementatio

我在添加GooglePlaces新库时出错

实现'com.google.android.libraries.places:places:1.1.0'

我尝试了所有这些解决方案

dependencies {
    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
        transitive = true;
    }
    implementation project(path: ':calendar')
    implementation 'com.google.firebase:firebase-core:11.0.4'
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.6'
    implementation 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.android.gms:play-services-maps:11.0.4'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-location:11.0.4'
    implementation 'com.google.android.gms:play-services-places:11.0.4'
    implementation 'com.google.android.gms:play-services-base:11.0.4'
    implementation 'com.google.android.gms:play-services-identity:11.0.4'
    implementation 'com.google.android.gms:play-services-auth-api-phone:11.0.4'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.baoyz.pullrefreshlayout:library:1.2.0'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.daimajia.easing:library:2.0@aar'
    implementation 'com.daimajia.androidanimations:library:2.2@aar'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'me.relex:circleindicator:1.2.2@aar'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.github.applikeysolutions:cosmocalendar:1.0.4'
    implementation 'com.google.maps.android:android-maps-utils:0.4.4'
    implementation 'com.android.support:multidex:1.0.0'
    implementation 'com.hbb20:ccp:2.2.2'
    implementation 'com.github.GoodieBag:Pinview:v1.3'
    implementation 'com.crystal:crystalrangeseekbar:1.0.0'
    implementation 'com.github.douglasjunior.BetterSpinner:library:bugfix-1.1.0-2'
    implementation 'com.github.mabbas007:TagsEditText:1.0.5'
    implementation 'com.github.vihtarb:tooltip:0.1.9'
    implementation 'com.github.warkiz:IndicatorSeekBar:v1.2.1'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'com.github.broakenmedia:MultiContactPicker:1.7'
    testImplementation 'junit:junit:4.12'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.15'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.dc.easyadapter:easyadapter:2.0.3'
    implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
    kapt 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'com.jakewharton.timber:timber:4.5.1'
    implementation 'com.google.dagger:dagger:2.19'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
    implementation 'com.google.dagger:dagger-android:2.19'
    implementation 'com.google.dagger:dagger-android-support:2.19'
    implementation 'com.andrognito.flashbar:flashbar:1.0.2'
    implementation 'com.laimiux.rxnetwork:rxnetwork:0.0.4'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    debugINImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    debugDEImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
    stagingImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
    implementation 'android.arch.persistence.room:runtime:1.1.1'
    implementation 'com.android.support:support-annotations:27.1.1'
    kapt "android.arch.persistence.room:compiler:1.1.1"
    // if you use the support libraries
    kapt 'com.google.dagger:dagger-android-processor:2.19'

}

======================================================================

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
        repositories {
            google()
            jcenter()
            mavenCentral()
            maven { url 'https://maven.fabric.io/public' }
            maven { url 'https://plugins.gradle.org/m2/'}
        }

    }

    dependencies {
//        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {

        repositories {
            google()
            jcenter()
            maven { url "https://jitpack.io" }
            mavenCentral()
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext.deps = [
        // Test dependencies
        junit      : 'junit:junit:4.10',
        festandroid: 'com.squareup:fest-android:1.0.7',
        robolectric: 'org.robolectric:robolectric:2.2',
        intellijannotations: 'com.intellij:annotations:12.0'
]

需要将项目与新的Google Places SDK同步

尝试添加一个不同的版本,如16.0.9或firebase的最新依赖项,这对我很有用。

因为您使用的是一个信号,它使用的是旧版本的12.0.1 firebase和gms库。为此,您需要添加一个解析策略,以转换为所需的版本

当firebase消息在其他库中使用时,您可以从build.gradle文件中删除此项:

implementation 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
在你的app build.gradle文件中使用它,并将谷歌服务版本更新为16.0.0

implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.6'
implementation 'com.onesignal:OneSignal:3.11.1'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'

implementation 'com.google.android.libraries.places:places:1.1.0'

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested

        if (requested.group == 'com.google.android.gms' && (requested.name == 'play-services-measurement-base')) {
            details.useVersion '15.0.2'  //use a common gms version here
        }

        if (requested.group == 'com.google.android.gms' && (requested.name == 'play-services-basement')) {
            details.useVersion '15.0.1'  //use a common gms version here
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-messaging'){
            details.useVersion '15.0.0'
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-iid'){
            details.useVersion '16.0.0'
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-analytics-impl'){
            details.useVersion '15.0.2'
        }
    }
}
我只尝试过以上依赖项。我没有添加你在应用程序中使用的所有其他依赖项

您可以分析应用程序依赖关系,并查看哪些版本库正在Android studio终端中使用下面的命令

 ./gradlew app:dependencies

我尝试了所有可能的情况,例如新版本17.0.0和16.0.9,旧版本也无法同步项目。添加此项时,您会遇到哪种类型的错误?