代码之家  ›  专栏  ›  技术社区  ›  turtleboy

无法解析:om.google.android.gms:播放服务位置:15.0.1

  •  1
  • turtleboy  · 技术社区  · 6 年前

    我正在尝试将FusedLocationProviderClient集成到我的应用程序中,但在尝试构建时我得到了以下信息。

    无法解析:om.google.android.gms:播放服务位置:15.0.1

    以下是我的Gradle构建文件。

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.2'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    

    .

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 'Google Inc.:Google APIs:23'
        buildToolsVersion "24.0.3"
    
        useLibrary 'org.apache.http.legacy'
    
        lintOptions {
            checkReleaseBuilds false
            // Or, if you prefer, you can continue to check for errors in release builds,
            // but continue the build even when errors are found:
            abortOnError false
        }
    
    
    
        defaultConfig {
            applicationId "com.carxxxxxxxx"
            minSdkVersion 16
            targetSdkVersion 21
            versionName "4.2"
            setProperty("archivesBaseName", "RR4v$versionName")
        }
    
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
            }
        }
    }
    
    dependencies {
        compile files('libs/activation.jar')
        compile files('libs/additionnal.jar')
        compile files('libs/core.jar')
        compile files('libs/mail.jar')
        compile files('libs/ndeftools-1.2.3.jar')
    
        compile files('libs/gcm.jar')
        compile 'com.android.support:appcompat-v7:23.4.0'
        compile 'com.google.android.gms:play-services:9.8.0'
        compile 'joda-time:joda-time:2.1'
        compile 'net.zetetic:android-database-sqlcipher:3.5.6@aar'
        compile 'com.android.support:support-v4:23.4.0'
        compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
        compile 'com.android.support:design:23.0.1'
        compile 'om.google.android.gms:play-services-location:15.0.1'
    }
    

    .

    我尝试过的事情:

    通过SDK管理器更新播放服务。我已将播放服务更新为版本49。

    我还将以下内容添加到模块渐变文件的底部

    apply plugin: 'com.google.gms.google-services'
    

    . 但当它被添加时,我得到了以下信息。

    Error:(52, 0) Plugin with id 'com.google.gms.google-services' not found.
    

    在我引用FusedLocationProviderClient的活动中,IDE识别它,这证明它可以访问API,但是当我同步项目时,我会得到上面的错误。

    有人对我怎样才能建设这个项目有什么想法吗?

    [编辑1] 在Gradle中指定位置库时,我错过了第一个“c”。它现在生成,但有以下错误

    FATAL EXCEPTION: main
                                                                           Process: com.carefreegroup.rr3, PID: 29793
                                                                           java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzaa;
                                                                               at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
                                                                               at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                               at android.app.ActivityThread.installProvider(ActivityThread.java:6335)
                                                                               at android.app.ActivityThread.installContentProviders(ActivityThread.java:5927)
                                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5866)
                                                                               at android.app.ActivityThread.-wrap3(ActivityThread.java)
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                               at android.os.Looper.loop(Looper.java:154)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:6692)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
    06-22 15:36:46.515 29793-29793/com.carefreegroup.rr3 E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzaa" on path: DexPathList[[dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-support-annotations-26.1.0_b1c3fd564d5ecfdcb62b644768ecca337343cb9e-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-net.zetetic-android-database-sqlcipher-3.5.6_362b79dadc345b00e10838b14b67e405c03e79c7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-ndeftools-1.2.3_d8e4c8b7efb3fc4b38515a52bea40ebd717191a7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-mail_0ad9467cae68efe0e449853bfb78d43febc95da8-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-joda-time-2.1_1e4cbce3224e3d224479fd252862c4c067bb4da7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-internal_impl-24.0.0_f9a2b7cd8b31b61fe4fab0b463cc909cba990dd7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-gcm_621f1872e8d51f9dcca43295925beefab27ed5e7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-core_40b68ca7ff2fcfffb2c88be2a48aa2e78ae1aee0-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-commons-io-2.4_b2955a73e8fdec69863902c786dced8321b28c5c-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-common-1.0.0_f7672573fa37446673eaa88579d58078904e990d-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-common-1.0.0_a6cdb13794e37e6755bb3175a1c2949c57aa762e-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-storage-common-9.8.0_b8d8fb8b0334158172a3557f684208cac2134df7-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-storage-9.8.0_7f2cbef560b512db3db737445ff67018b147c674-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-messaging-9.8.0_06772696a3db3062d328be96e4fb54512b08ce43-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.8.0_84464eee81f3d8e40a16475a883b6a970a409063-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-database-connection-9.8.0_a338c40305ca169a1e5d3508117759b4ef9da67b-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-database-9.8.0_9a93c706af63055d19fe8bb30a424f351eecfd40-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-crash-9.8.0_eaf82e24036ade30f0f58141ff17dba05010e8be-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-config-9.8.0_6302ad83497b632e068669a12abe527803a4f66b-classes.dex", dex file "/data/data/com.car
    06-22 15:36:46.515 29793-29793/com.carefreegroup.rr3 E/AndroidRuntime: efreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-common-9.8.0_5dcf65edfa69f44011c20f89df5e774c1477962b-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-auth-module-9.8.0_c19afd87b34db3f9dc643882ede03bb0597a2d89-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-auth-common-9.8.0_32f92fb86c061eb466121b50f11c6d28b5fdc5d2-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-auth-9.8.0_714319e67eb621a07f75a50e2ed811624af4706e-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-analytics-impl-9.8.0_1dabd2be22269f3583babd2513c90ea2222e4726-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.firebase-firebase-analytics-9.8.0_718fcdc2eed1e68a1c943f54ecf3a47d2bfed54b-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-wearable-9.8.0_414efc73bdf239f364c3ca12392a0c95730d2a68-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-wallet-9.8.0_ca4cca5bdd3693fb497c67278dffc385f9c31d40-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-vision-9.8.0_eabf6064cfd3e690dd60e87e5ee5cf0e714bd4f5-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-tasks-15.0.1_6300ded0df2926f1e262112a47bff4afb81f143a-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-tagmanager-api-9.8.0_572206f7825abd4c3970f39685e8d4be5c26e1e0-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-tagmanager-9.8.0_222869e0459be8e006394e02b4c353f591cff2db-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-safetynet-9.8.0_2ef4d8bc63b73583b6c063c92f45d51c0b523b6e-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-plus-9.8.0_aea07a4869fab8a5aad03e3be7fc87a93769bf67-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-places-placereport-15.0.1_50d0b17caa62f9f0d443e68efed44d7637c3f2c8-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-places-9.8.0_6430b510143c87c983f988fd804498e35ceee515-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-panorama-9.8.0_f664bea1a95d82f56ebda55701eb3bf66ed42dbe-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-nearby-9.8.0_4db655131ed2343faa64d231f29f74d02345cb48-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-maps-9.8.0_344d99ecc44d9a01a1c5f585dd2e4fd50e8d5759-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-location-15.0.1_2a72c123568cef8a10af2437e5d034a77d169581-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-instantapps-9.8.0_a96918b554854ff71ca450cf2fbdbd15a3184f5b-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-iid-9.8.0_9f043782f6a7731e3b7ba137eaca0ad8023e4222-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-identity-9.8.0_003937bd846dfec2c6eaaab17891025599c2c455-classes.
    06-22 15:36:46.515 29793-29793/com.carefreegroup.rr3 E/AndroidRuntime: dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-9.8.0_3a641c4fa261900718ae00226a9486e106a0f2c3-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-gass-9.8.0_fdf2f881d56c64a7e69c03cc13a305747199d95c-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-games-9.8.0_5325f3e507d018182f64bec45cd571cd82d5f531-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-fitness-9.8.0_b85a4c11e1d1ea3d1e8c44c141eb9fd243114bea-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-drive-9.8.0_f46afd9b54f894c83a843262aaf7ecdf81ac97ac-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-clearcut-9.8.0_3ec857b653bf0dd77bd1618492aea2cfd7454e27-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-cast-framework-9.8.0_dd84ad641fb775d779e90fc4de3112ddc5c5c88b-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-cast-9.8.0_2317c840d52e11fe22bc0d195ad10f03afbfd869-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-15.0.1_613d53b57c76d8988e518be6e33e40231098d312-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-base-15.0.1_de76574f2e7c1849634dd3996584d30a8c8f51aa-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-awareness-9.8.0_c830c622dc415a15ae468d721575209cb00fbc33-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-auth-base-9.8.0_3affee785367cca3503deeec5238df4b1d0d3248-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-auth-9.8.0_c274be6a8919c09cc58fe5ebce9f8b36df9b04fc-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-appinvite-9.8.0_4bfa47f66b0028b1cda692afb2ad9991d55eddc9-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-appindexing-9.8.0_fe81b35e9ebdc8e51526f94a011faf1c81be9d32-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-analytics-impl-9.8.0_b63fb5f55f81f69f34d2ac78922f969054091e79-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-analytics-9.8.0_80236ec5d61533b106033715a73072fd1e86b7f4-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-ads-lite-9.8.0_8a3436df8b7de462e294cbd5f9ccf600eddfdfb5-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.google.android.gms-play-services-ads-9.8.0_f91ace972612b7c15d5eda5f2d83ef2f56ed14e6-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-vector-drawable-24.0.0_661cb1f51ace368d8fb0e4543e29b2681f6eee01-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-v4-26.1.0_fed166d13e00fe4e9291236166676c596785fa15-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-media-compat-26.1.0_229c8b9623123c80e9a4371644dd1b65aff3dbf9-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-fragment-26.1.0_cc91da52f7d2a8
    06-22 15:36:46.515 29793-29793/com.carefreegroup.rr3 E/AndroidRuntime: be426d67ac8f720460d6495ea6-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-core-utils-26.1.0_f001bb9582e43919af31d9952cba8666ef81800a-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-core-ui-26.1.0_d59da5f15b149a5b9abebf9e9c0690c15a85801a-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-support-compat-26.1.0_02f58d81be135b61343f8446ecc938854745faa3-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-palette-v7-24.0.0_cdbd25b44cb8972c254d6e543f8d71671c9354ba-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-mediarouter-v7-24.0.0_f3eb1a603553a33ae090463b3ce0fd1d8a4364d5-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-design-23.0.1_27c309a4f168dfc3cbef3ee1e4d618e1060fba29-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-appcompat-v7-24.0.0_a9d2ba3ca8b729f930e0bf269ff9ce4dede4b709-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-24.0.0_a04bbcac6aad30e6b1fe0e13e96449cf2275e7d5-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-android.arch.lifecycle-runtime-1.0.0_3797c4e5ba8a3f99b73e759cb32865a05ab2dd61-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-additionnal_dcade8278be2c7528383ff71ed88b0d6f4b4e277-classes.dex", dex file "/data/data/com.carefreegroup.rr3/files/instant-run/dex/slice-activation_0feaebd416774137c1452732c61af9b81edda894-classes.dex"],nativeLibraryDirectories=[/data/app/com.carefreegroup.rr3-2/lib/arm64, /system/fake-libs64, /data/app/com.carefreegroup.rr3-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
                                                                               at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                               at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
                                                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                                                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Bubu    6 年前

    你把第一个“c”忘在“com”上了:

    compile 'com.google.android.gms:play-services-location:15.0.1'