自从我更新到Android Studio3.1后,我的项目就不再运行了。我在互联网上到处寻找解决办法,但没有任何积极的结果。下面是我在logcat中得到的错误:
--------- beginning of crash
04-13 13:33:55.466 12720-12720/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: woopy.domain.com.woopy, PID: 12720
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/base.apk"],nativeLibraryDirectories=[/data/app/woopy.domain.com.woopy-KqNv1gE1ZomaesHCq33DJw==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
04-13 13:33:55.567 12720-12727/? I/zygote: Debugger is no longer active
这是我的build.gradle(module:app)文件:
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "woopy.domain.com.woopy"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
aaptOptions {
cruncherEnabled = false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.parse:parse-android:+'
implementation 'com.parse.bolts:bolts-android:1.+'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'
implementation 'com.commit451:PhotoView:1.2.4'
}
下面是我的build.gradle(项目:appname):
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
编辑:它不再成功构建了,它在构建消息控制台中抛出了一个非常奇怪的错误:
AGPBI: {"kind":"error","text":"Program type already present: com.google.android.gms.location.places.zza","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'
.
尝试将此依赖项添加到您的gradle文件:
implementation 'com.android.support:multidex:1.0.3'
此外,您应该对支持和播放服务库使用相同的版本。并且应该避免在最新版本中使用“+”。更改此物料:
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:+'
implementation 'com.google.android.gms:play-services-ads:+'
变成这样:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "12.0.1"
}
}
}
}
}
implementation 'com.google.android.gms:play-services:12.0.1'
我试着用android studio安装一个react-native应用程序,安装apk后应用程序就会停止。 以下是带有错误的logcat: 我尝试了很多事情:清洁,重建,...库的版本似乎在任何需要的地方都是一样的,multidex似乎是正确设置的。 你能帮帮我吗? 谢谢!
e/androidruntime:致命异常:main process:com.eldercare.fajri.eldercare,pid:30948 java.lang.noClassDefFounderror:解析失败:lcom/google/android/gms/common/internal/zzbp;在com.google.firebase.firestore.firebase.fire
问题内容: 我正在按照教程(链接)将图像上传到Firebase数据库,但遇到以下错误。我重新检查了gradle依赖项并启用了multidex支持,但仍然存在错误 Gradle.app 请在这里告诉我我做错了! 问题答案: 现在这是问题所在,您在gradle的依赖项中使用了不同的版本,请更改此 对此 还有一件事是现在不建议使用,因此您需要替换为 ,这是该https://firebase.google
gradle.app 请告诉我这里做错了什么!
AndroidManifest.xml: 我知道NoClassDefFoundError是做什么的,但我没有发现问题。询问你是否需要更多的解决问题的文件。
错误:将字节码转换为dex时出错:原因:com.android.dex。DexException:多个dex文件定义Lcom/google/android/gms/internal/zzbqy; 这个错误出现在我的android聊天应用程序中,我在这里找到了几个答案,但它无法解决我的问题。我正在为我的项目使用Firebase,我已经成功地对我的用户进行了身份验证,并想在实时数据库中应用他们的照片和