我怎样才能让我的应用程序运行,并解决了这个错误

问题描述 投票:1回答:1

我是在Android上做移动应用程序,并得到一些真正的一些错误,我无法获得解决。就像this第一个错误

我的应用程序是的gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "com.example.dygy.chat"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true






    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    exclude group: 'com.android.support', module: 'support-v7'
    testCompile 'junit:junit:4.12'
}
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'
    })




    //Add Library
    compile 'com.android.support:design:25.3.1'
    compile 'com.firebaseui:firebase-ui:0.6.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.google.firebase:firebase-config:10.0.1'
    compile 'com.google.firebase:firebase-crash:10.0.1'
}
apply plugin: 'com.google.gms.google-services'

我加入

exclude group: 'com.android.support', module: 'support-v7+'

还可以添加

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

 multiDexEnabled true

从25.0.1和设计同样的方式升级到25.3.1支持,因为它增加multidex 1.0.1什么我需要做的后推荐给我?在升级插件按什么都不做。一天前,我推到github上完整的项目,因此,如果它需要here you go

此外,采取了一些错误还挺

错误:执行失败的任务“:应用程序:transformClassesWithJarMergingForDebug”。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复的条目:COM /谷歌/安卓/ GMS /认证/ API /登入/内部/ zzf.class比PPL告诉我clead-重建项目,所以现在sayng像

(30,1)出现问题评估项目“:应用程序”。 >找不到方法排除()为参数[{组= com.android.support,模块=支持-V7}]上式org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe pendencyHandler的对象。所以我做出改变

 compile 'com.android.support:appcompat-v7:25.3.1' {
        exclude group: 'com.android.support', module: 'support-v7'
    }

但现在它的故事我

Error:(29, 0) Could not find method com.android.support:appcompat-v7:25.3.1() for arguments

[build_kymyozhw5iecrml565pxornd $ $ _run_closure2 @ _closure7 3e83 7D7]上式org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe pendencyHandler的对象。请从Android SDK管理器安装Android支持库。开放的Android SDK管理器

但他们都被安装!所以我不知道如果我改变了一些问题,或者只是添加新的。请帮助我。

编辑现在第一后回答我gradle这个是:

apply plugin: 'com.android.application'
android {

    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "com.example.dygy.chat"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true






    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile 'com.android.support:multidex:1.0.1'
    compile ('com.android.support:appcompat-v7:25.3.1') {
        exclude group: 'com.android.support', module: 'support-v7'
    }
    testCompile 'junit:junit:4.12'
}
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'
    }
    //Add Library
    compile 'com.android.support:design:25.3.1'
    compile 'com.firebaseui:firebase-ui:0.6.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.google.firebase:firebase-config:10.0.1'
    compile 'com.google.firebase:firebase-crash:10.0.1'
}
apply plugin: 'com.google.gms.google-services'

我有这个错误

错误:执行失败的任务“:应用程序:transformClassesWithJarMergingForDebug”。

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复的条目:COM /谷歌/安卓/ GMS /认证/ API /登入/内部/ zzf.class

java android android-studio gradle
1个回答
2
投票

当你括号添加了闭包来摇篮,你需要使用前面的参数加上括号。

IOW,更换:

compile 'com.android.support:appcompat-v7:25.3.1' {
    exclude group: 'com.android.support', module: 'support-v7'
}

有:

compile ('com.android.support:appcompat-v7:25.3.1') {
    exclude group: 'com.android.support', module: 'support-v7'
}

并替换:

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

有:

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
    exclude group: 'com.android.support', module: 'support-annotations'
}
© www.soinside.com 2019 - 2024. All rights reserved.