【问题标题】:appcompat-v7:27.0.1 Issue with play-services-mapsappcompat-v7:27.0.1 播放服务地图问题
【发布时间】:2017-11-14 21:01:30
【问题描述】:

我有这个 gradle

dependencies {
    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 'com.estimote:sdk:1.4.0'
    compile 'com.android.support:appcompat-v7:27.0.1'
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true;
    }
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.afollestad.material-dialogs:core:0.9.5.0'

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

}

我对 appcompat-v7:27.0.1 和 google play 服务有疑问。 如果我使用 26.0.1,google play 服务没有问题,但不能使用 afollestand 0.9.5.0。 我需要适用于 appcompat-v7:27 的 afollestand 0.9.5.0

更新: Gradle image

【问题讨论】:

  • 有什么问题?
  • 我需要 afollestand 0.9.5.0 因为我需要 appcompact v7 27.0.1 但谷歌无法正常工作
  • 为什么不起作用?有什么错误吗?
  • appcomat错误是我删除地图时其他正在使用其他版本编译错误disapier
  • 你应该阅读这个blog.mindorks.com/…。只要确保所有库都使用相同的版本。你怎么知道的?运行 ./gradlew app:dependencies on linux 和 windows gradlew.bat app:dependencies on windows

标签: android gradle dependencies


【解决方案1】:

我也遇到了同样的问题。用户 raghunandan 的建议有所帮助。

在您的 Apps 文件夹中使用 ./gradlew app:dependencies(或在 Windows 上使用 ./gradlew.bat app:dependencies),您可以获得所有包的依赖关系树。

您可以在此处看到“play-services-maps”需要一些版本为25.2.0 的支持包,但其中大多数都已升级到 27.0.2。但并非全部出于某种原因。不过,您可以手动执行此操作,直接包含它们! (无论如何,它们都会成为您的 APK 的一部分)

compile 'com.android.support:support-v4:27.0.2'

将它与 support-v7 一起添加到您的应用 build.gradle 中,它就会起作用。

【讨论】:

  • 我添加了那个编译行,但是混合版本时出错,一些库使用 v7:25...
  • 再次检查 app:dependencies。哪一个被列为使用 25.x?你自己包括他们吗?然后升级版本。他们是被别的东西拉进来的吗?将它们手动包含为 27.0.2。
  • 这解决了您的问题吗?如果不是,怎么回事,如果是,请接受这个答案。
  • 我还没有参与这个项目,但我最后一次检查时,我猜是使用 25.x 的地图服务
【解决方案2】:

我尝试了一切,但真正的答案是等待和更新播放服务。 现在我的 gradle 看起来像:

   android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "xxx.YYY"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "https://maven.google.com"
    }
}

dependencies {

compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
    transitive = true;
}
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.afollestad.material-dialogs:core:0.9.6.0'
testCompile 'junit:junit:4.12'

并且有 0 个错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-19
    • 1970-01-01
    • 1970-01-01
    • 2020-07-17
    • 2017-02-13
    • 2015-01-07
    • 2016-10-28
    相关资源
    最近更新 更多