gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 19:11:27 25 4
gpt4 key购买 nike

我在 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

另外,它有点错误

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/api/signin/internal/zzf.class than ppl tell me to clead-rebuild project, so it now sayng like

(30, 1) A problem occurred evaluating project ':app'. > Could not find method exclude() for arguments [{group=com.android.support, module=support-v7}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe‌​pendencyHandler. so i make change to

 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] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDe‌​pendencyHandler. Please install the Android Support Repository from the Android SDK Manager. Open Android SDK Manager

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

编辑现在在第一次回答后我的 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'

我有这个错误

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/api/signin/internal/zzf.class

最佳答案

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

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'
}

关于java - 我怎样才能让我的应用程序运行并解决这个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45167564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com