首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Gradle -无法展开zip cardview-v7-23.3.0.aar

Gradle -无法展开zip cardview-v7-23.3.0.aar
EN

Stack Overflow用户
提问于 2017-08-31 00:56:50
回答 2查看 164关注 0票数 0

我尝试将firebase实现到我的应用程序中。但是firebase和google play服务之间存在冲突。下面是我的模块build.gradle:

代码语言:javascript
运行
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.example.nefrin.client"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        // Enabling multidex support.
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'



    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.github.tajchert:nammu:1.1.3'
    compile 'gun0912.ted:tedpermission:1.0.3'
    compile 'com.github.jksiezni.permissive:permissive:0.2'
    compile 'com.github.arimorty:floatingsearchview:2.0.3'
    //compile 'net.sf.sprockets:sprockets-android:4.0.0'
    compile 'com.github.michael-rapp:android-material-dialog:4.0.2'
    compile 'com.github.bumptech.glide:glide:3.5.2'

    compile 'com.google.firebase:firebase-auth:11.2.0'


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

下面是该项目的build.gradle:

代码语言:javascript
运行
复制
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'com.google.gms:google-services:3.1.0' // google-services plugin

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots'
        }
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }

    }

}

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

当我尝试运行这个应用程序时,尽管我没有在我的应用程序中使用cardview,但我得到了平衡:

代码语言:javascript
运行
复制
Error:Execution failed for task ':app:prepareComAndroidSupportCardviewV72330Library'.
> Could not expand ZIP 'C:\Users\Nefrin\.gradle\caches\modules-2\files-2.1\com.android.support\cardview-v7\23.3.0\abdf83a0192c03ff190f941c6c885af18d257a2c\cardview-v7-23.3.0.aar'.

Android Studio在编译文件'com.google.android.gms:play-services:11.0.4‘下划线,并表示:

代码语言:javascript
运行
复制
All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.2.0, 11.0.4. Examples include com.google.android.gms:play-services-basement:11.2.0 and com.google.android.gms:play-services:11.0.4 less... (Ctrl+F1) 

    There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)
EN

Stack Overflow用户

发布于 2017-08-31 01:02:07

正如错误所说,所有的google库都应该使用相同的版本。

因此,您应该更新play-services库并使用与firebase相同的版本:

代码语言:javascript
运行
复制
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45965952

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档