【问题标题】:Adapting dependencies after downgrading Google Play Services降级 Google Play 服务后调整依赖项
【发布时间】:2016-06-25 17:04:50
【问题描述】:

我应该编译什么而不是:

compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-base:9.0.2'
compile 'com.android.support:multidex:1.0.0'

在我的dependenciesbuild.gradle (Module:app) 当我downgraded Google Play Services from 9.0.83 to 8.1.18 manually 时?我的目的是避免这个日志错误:

06-24 18:50:24.488 7128-7759/com.noureddine_ouertani.www.wocelli50 E/DynamiteModule:无法加载模块描述符类:未找到 班级 “com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor” 在路径上:DexPathList[[zip 文件 "/data/app/com.noureddine_ouertani.www.wocelli50-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]

@呃。 Arjun saini:我收到了这个错误。 (我的 Manifest 文件配置正确。)

我现在正在尝试使用以下 build.gradle 进行清理:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.noureddine_ouertani.www.wocelli50"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        //incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-annotations:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
//compile 'com.google.android.gms:play-services:9.0.2'
//compile 'com.google.android.gms:play-services-maps:9.0.2'
//compile 'com.google.android.gms:play-services-location:9.0.2'
//compile 'com.google.android.gms:play-services-base:9.0.2'
//compile 'com.android.support:multidex:1.0.0'

compile 'com.android.support:multidex:1.0.1'

compile 'com.google.android.gms:play-services:+' //remove others instead of

}

编译作品。但是,当我转到路线跟踪活动时,我的应用程序希望我更新 Google Play 服务。我也看不到地图了。

我在降级后更新了 Google Play 服务并登陆 here

【问题讨论】:

    标签: java android google-maps


    【解决方案1】:

    通过更新代码来尝试我的答案

    首先编译构建

    编译'com.android.support:multidex:1.0.1'

    compile 'com.google.android.gms:play-services:+' //删除其他代替

    在你的 AndroidManifest.xml 添加这行 android:name

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:name="android.support.multidex.MultiDexApplication"
        >
    

    并且在你的 build.gradle 中也添加

    dexOptions {
        //incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }
    

    【讨论】:

    • 感谢您的回答。见@Er。 Arjun saini 在原帖中。
    • 再次感谢您的回答。肯定加一。但是我通过降级 Google Play 服务来避免原始日志错误的想法似乎行不通……
    猜你喜欢
    • 1970-01-01
    • 2018-12-23
    • 2013-11-03
    • 1970-01-01
    • 1970-01-01
    • 2016-05-13
    • 1970-01-01
    • 2015-08-30
    • 1970-01-01
    相关资源
    最近更新 更多