android - java.lang.NoClassDefFoundError : com. google.firebase.FirebaseOptions 我尝试了所有解决方案但我不知道解决方案

标签 android gradle firebase

如何解决问题?我什么都用了。这是重复的,但我都试过了。

classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:3.0.0'  

我也在使用 multiDexEnable = true

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'

repositories {
  maven { url 'https://maven.fabric.io/public' }
}

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"

  defaultConfig {
    applicationId "com.agilerise.school"
    minSdkVersion 11
    targetSdkVersion 23
    versionCode 3
    versionName "1.3"
    enforceUniquePackageName = false
    multiDexEnabled true
  }
  buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
        resValue "string", "google_maps_api_key",  "AIzaSyCPkzR0YESTkV97RaMW0iJvgxuW_2EpfPI"
    }
    debug {
        resValue "string", "google_maps_api_key", "AIzaSyD-rVHRsXJJFcThPFRgyBwKok3qXggMxtM"
    }

  }
  dexOptions {
    incremental true
    javaMaxHeapSize "4g"
  }
}

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  testCompile 'junit:junit:4.12'
  compile files('libs/gcm.jar')
  compile files('libs/YouTubeAndroidPlayerApi.jar')
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:23.1.1'
  compile 'com.android.support:support-v4:+'

  compile 'com.android.support:cardview-v7:23.1.1'
  compile 'com.android.support:recyclerview-v7:23.1.1'
  compile                                                   'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
  compile 'com.android.support:design:23.1.1'

  compile 'com.google.android.gms:play-services:10.0.1'
  compile 'com.google.android.gms:play-services-location:10.0.1'

  compile 'com.jpardogo.googleprogressbar:library:1.2.0'
  compile 'com.github.traex.rippleeffect:library:1.3'
  compile 'de.hdodenhof:circleimageview:2.0.0'
  compile 'com.nineoldandroids:library:2.4.0'

  compile 'com.daimajia.easing:library:1.0.1@aar'
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.daimajia.androidanimations:library:1.1.3@aar'
  compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true;
  }
  compile 'com.google.firebase:firebase-messaging:10.0.1'
}

apply plugin: 'com.google.gms.google-services'

查看播放服务

See PlayService

最佳答案

将类路径添加到 build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
}

关于android - java.lang.NoClassDefFoundError : com. google.firebase.FirebaseOptions 我尝试了所有解决方案但我不知道解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41929535/

相关文章:

android - 华为应用市场发布版6003错误码

java - Android Retrofit2 错误@Url

android - Google Maps API V2 请求中的非法字符 "|"

spring - org.hibernate.gradle.tools用户和密码在数据库部分不起作用

java - 如何创建 java web 服务来将数据写入 Firebase?

android - 在另一个之上显示 Android 对话框?

android - com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

android - 无法检测文件 : java. lang.NoClassDefFoundError android/content/ComponentCallbacks

Firebase 云函数身份验证触发时间

android - RecyclerView只显示两个textview?其他不显示...项目不显示