小编Ram*_*rel的帖子

当我从Android迁移到AndroidX时,在我的项目中实施Google Play服务时出错.可能是什么解决方案?

这是我的应用级别 build.gradle

apply plugin: 'com.android.application'
apply plugin: 'realm-android'
//apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "threecallistos.jumperr"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
    implementation 'com.google.android.material:material:1.0.0-alpha3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'androidx.multidex:multidex:2.0.0'
}
Run Code Online (Sandbox Code Playgroud)

gradle.properties在这里

org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)

当我删除

implementation 'com.google.android.gms:play-services-maps:15.0.1'
Run Code Online (Sandbox Code Playgroud)

app.build文件它工作正常.但我必须使用谷歌地图和服务,所以我在这里和那里搜索,但找不到任何适当的解决方案.我在github中找到了一个建议

我相信这是因为com.google.firebase传递上依赖于com.android.support:support-v4.为了解决这个问题,您应该能够在gradle.properties文件中设置android.enableJetifier = …

java android google-maps android-studio androidx

5
推荐指数
1
解决办法
4277
查看次数

标签 统计

android ×1

android-studio ×1

androidx ×1

google-maps ×1

java ×1