我最近将最新的google analytic 9.0.0添加到了我的应用中。该应用程序在较新的Android手机中运行良好,但当我尝试在较旧的Android设备中运行它时,我遇到了这个错误(我不会在我的应用程序的任何部分使用firebase auth):
05-31 11:50:33.466 5326-5326/xxxxxxxxxxxxxxx E/dalvikvm: Could not find class 'com.google.firebase.FirebaseOptions', referenced from method com.google.firebase.FirebaseApp.
05-31 11:50:33.476 5326-5326/xxxxxxxxxxxxxxx E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApp$zzb', referenced from method com.google.firebase.FirebaseApp.zzaJ
以下是我的gradle文件
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "xx.xxxxxxxxxx.xx"
minSdkVersion 16
targetSdkVersion 23
versionCode 4
versionName "1.0.3"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':volley')
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'com.android.support:design:23.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.lorentzos.swipecards:library:1.0.9@aar'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-identity:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.wang.avi:library:1.0.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'me.alexrs:wave-drawable:1.0.0@aar'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'org.apache.httpcomponents:httpmime:4.5'
compile 'com.github.aakira:expandable-layout:1.5.1@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
}
答案 0 :(得分:0)
如果您还没有,请更新您的Google Play服务'从Android SDK Manager到版本30>附加功能。
然后将行编译com.android.support:multidex:1.0.1
添加到您的依赖项中(如果不需要,只需删除multiDexEnabled true
将此属性添加到清单中的应用程序代码:android:name="android.support.multidex.MultiDexApplication"