我在Android应用中使用了几个Google服务,并且在v11.8.0
之前已经升级到v15.0.0
。这是我尝试运行项目时遇到的错误:
Exception in thread "main" java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:483)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:621)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:331)
at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:91)
at org.objectweb.asm.ClassVisitor.visitEnd(ClassVisitor.java:339)
at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:112)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:702)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/android/gms/internal/zzbfm
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.devtools.build.android.desugar.LambdaDesugaring.findTargetMethod(LambdaDesugaring.java:327)
at com.google.devtools.build.android.desugar.LambdaDesugaring.queueUpBridgeMethodIfNeeded(LambdaDesugaring.java:236)
at com.google.devtools.build.android.desugar.LambdaDesugaring.access$200(LambdaDesugaring.java:56)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:413)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1623)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
Caused by: java.lang.ClassNotFoundException: Class com.google.android.gms.internal.zzbfm not found
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/android/gms/internal/zzbfm
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:83)
at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:54)
at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:41)
at java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:1067)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.toMethodHandle(LambdaDesugaring.java:660)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.toJvmMetatype(LambdaDesugaring.java:647)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:408)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1623)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
Caused by: java.lang.ClassNotFoundException: Class com.google.android.gms.internal.zzbfm not found
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
这是我的build.gradle
文件:
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/glomadrian/maven" }
}
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.android.app"
minSdkVersion 19
targetSdkVersion 27
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
versionCode 149
versionName "1.1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
// multiDexKeepProguard file('multidex-config.pro')
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
lintOptions {
disable 'MissingTranslation'
}
}
}
dexOptions {
keepRuntimeAnnotatedClasses false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true;
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.exoplayer:exoplayer-core:r2.5.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:r2.5.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:r2.5.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:r2.5.4'
implementation 'com.google.android.exoplayer:extension-rtmp:r2.5.4'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:r2.5.4'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation "com.google.firebase:firebase-core:15.0.0"
implementation "com.google.firebase:firebase-messaging:15.0.0"
implementation "com.google.firebase:firebase-config:15.0.0"
implementation "com.google.android.gms:play-services-gcm:15.0.0"
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'io.realm:android-adapters:2.1.1'
implementation 'org.parceler:parceler-api:1.1.6'
implementation 'com.jakewharton:butterknife:8.6.0'
implementation 'com.evernote:android-job:1.2.4'
implementation 'com.flurry.android:analytics:6.4.2'
implementation 'com.amazonaws:aws-android-sdk-core:2.6.0'
implementation 'com.amazonaws:aws-android-sdk-pinpoint:2.6.0'
implementation 'com.amazonaws:aws-android-sdk-sns:2.6.0'
implementation 'com.wdullaer:materialdatetimepicker:3.1.3'
testImplementation 'junit:junit:4.12'
kapt 'org.parceler:parceler:1.1.5'
kapt 'com.jakewharton:butterknife-compiler:8.6.0'
implementation 'com.google.android:flexbox:0.3.0-alpha3'
implementation 'com.airbnb:deeplinkdispatch:3.1.0'
kapt 'com.airbnb:deeplinkdispatch-processor:3.1.0'
implementation 'com.google.dagger:dagger:2.11'
kapt 'com.google.dagger:dagger-compiler:2.11'
implementation 'jp.wasabeef:fresco-processors:2.1.0'
implementation 'com.github.franmontiel:LocaleChanger:0.9.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation "com.radioafricagroup.payments:payments-sdk:0.0.15"
implementation "com.radioafricagroup.billing:billing-sdk:0.0.6"
implementation 'io.reactivex.rxjava2:rxkotlin:2.1.0'
implementation "org.jetbrains.anko:anko:$anko_version"
implementation "org.jetbrains.anko:anko-commons:$anko_version"
implementation "org.jetbrains.anko:anko-design:$anko_version"
implementation "org.jetbrains.anko:anko-recyclerview-v7:$anko_version"
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.16'
implementation('com.appsee:appsee-android:2.3.4@aar') {
transitive = true
}
implementation('io.fabric.sdk.android:fabric:1.3.10@aar') {
transitive = true
}
implementation 'com.github.ronaldsmartin:Material-ViewPagerIndicator:1.0.4'
implementation 'com.github.florent37:rxgps:1.0.1'
implementation 'com.github.fondesa:kpermissions:1.0.0'
implementation 'com.hendraanggrian:recyclerview-paginated:0.6'
implementation 'com.airbnb.android:lottie:2.5.0-rc1'
implementation 'com.amitshekhar.android:android-networking:1.0.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
kapt 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'jp.wasabeef:glide-transformations:3.2.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
}
apply plugin: 'com.google.gms.google-services'
我已尝试使用v15.0.2
Firebase
个v15.0.1
服务和Google
v11.8.0
个Google services plugin
服务,但它们都会产生相同的结果。
将所有内容还原为3.3.0
,但任何更新都不会有效。什么改变了?
我已将buildscript {
ext.kotlin_version = '1.2.41'
ext.anko_version = '0.10.4'
ext.google_services_version = '15.0.2'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:3.5.0"
// 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://maven.google.com' }
google()
}
}
版本更新为{{1}},但问题仍然存在。
//顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。
{{1}}
我已多次清理项目,无效缓存并多次重启Android Studio,但没有任何更改。
答案 0 :(得分:0)
请参阅https://firebase.google.com/support/release-notes/android
并在Android项目中添加适当的firebase服务。
答案 1 :(得分:0)
您必须使用Google Play服务插件3.3.0:
if (data instanceof Array) {
$(data).each(function () {
$("<input type='hidden'>").attr({
name : this.name,
value : this.value
}).appendTo(form);
});
} else {
$.each(data || {}, function (name, value) {
$("<input type='hidden'>").attr({
name : name,
value : value
}).appendTo(form);
});
}