Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使我的应用程序运行并解决此错误_Java_Android_Android Studio_Gradle - Fatal编程技术网

Java 如何使我的应用程序运行并解决此错误

Java 如何使我的应用程序运行并解决此错误,java,android,android-studio,gradle,Java,Android,Android Studio,Gradle,我在安卓系统上制作手机应用程序时,遇到了一些我无法解决的错误。 第一个错误是 我的应用程序的渐变是 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.1" defaultConfig { applicationId "com.example.dygy.chat" minSdkVersion 16

我在安卓系统上制作手机应用程序时,遇到了一些我无法解决的错误。 第一个错误是

我的应用程序的渐变是

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'

将支持从25.0.1升级到25.3.1,并以相同的方式设计,因为在添加multidex 1.0.1后,它向我推荐了我需要做什么?按下升级插件什么也不做。一天前,我推进了github的完整项目,所以如果需要的话

而且,它也犯了一些错误

错误:任务的执行失败 “:app:transformClassesWithJarMergingForDebug”。> com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目: com/google/android/gms/auth/api/signin/internal/zzf.class 比ppl告诉我清理重建项目,所以它现在说像

(30,1)评估项目时出现问题:“应用程序”。>找不到 参数[{group=com.android.support]的方法exclude(), 类型的对象上的module=support-v7}] org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe‌​彭德基·汉德尔。 所以我改了

但现在是我

[build_KymozHW5IECRML565PXORND$\u run_closure2$_closure7@3e83‌​7d7]on 类型的对象 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe‌​彭德基·汉德尔。 请从Android SDK安装Android支持存储库 经理打开Android SDK管理器

但是他们都被安装了!所以我不确定我是否改变了一些问题,或者只是添加了新的问题。请帮帮我

编辑 在第一次回答之后,我的回答是:

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'
我有这个错误

错误:任务的执行失败 “:app:transformClassesWithJarMergingForDebug”

com.android.build.api.transform.TransformException:java.util.zip.zipeException:重复条目: com/google/android/gms/auth/api/signin/internal/zzf.class


当使用大括号向Gradle添加闭包时,需要在前面的参数周围使用括号

注意,替换:

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'
})
与:


你升级了它所要求的吗?我仍然希望它运行,你的意思是什么?感谢现在我们返回到=D>错误:任务执行失败>':app:transformclasses with jarmergingfordebug'>com.android.build.api.transform.TransformException:>java.util.zip.zipeException:重复条目:>com/google/android/gms/auth/api/signin/internal/zzf.class
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'
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'
}