为什么Firebase无法使用Adincube广告SDK?

时间:2018-04-12 06:41:06

标签: android firebase

firebase sdk在adincube ad sdk库中遇到问题。每当我同时使用(firebase和adincube sdk)时。我的Android应用程序在开始时崩溃,我收到此错误。



E / AndroidRuntime: FATAL EXCEPTION: main
Process: com.ecodehut.livetvapp, PID: 4198
java.lang.NoSuchMethodError: No static method zzb(Ljava / lang / Object; Ljava / lang / Object;) Ljava / lang / Object; in class Lcom / google / android / gms / common / internal / zzbo;
or its super classes(declaration of 'com.google.android.gms.common.internal.zzbo'
    appears in /data/app / com.ecodehut.livetvapp - xTf3fCMoMpesy8u03iKJSg == /split_lib_dependencies_apk.apk)
    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source: 2) at android.app.ActivityThread.installProvider(ActivityThread.java: 6285) at android.app.ActivityThread.installContentProviders(ActivityThread.java: 5851) at android.app.ActivityThread.handleBindApplication(ActivityThread.java: 5772) at android.app.ActivityThread. - wrap1(Unknown Source: 0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 1661) at android.os.Handler.dispatchMessage(Handler.java: 105) at android.os.Looper.loop(Looper.java: 164) at android.app.ActivityThread.main(ActivityThread.java: 6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java: 240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 767)




我在发布之前尝试了所有内容。但似乎没有任何效果。现在我不确定发生了什么。

以下是build.gradle(App):



apply plugin: 'com.android.application'

android {
  compileSdkVersion 27
  defaultConfig {
    applicationId "com.ecodehut.livetvapp"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

repositories {
  jcenter()
  //maven { url 'http://repository.adincube.com/maven' }
  //maven { url 'https://maven.google.com' }
}

dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  implementation 'com.android.support:appcompat-v7:27.1.0'
  implementation 'com.android.support:design:27.1.0'
  implementation 'com.android.support:cardview-v7:27.1.0'
  implementation 'com.android.support:support-v4:27.1.0'
  implementation 'com.google.firebase:firebase-storage:11.0.4'
  compile 'com.android.support:recyclerview-v7:27.1.0'
  compile 'com.android.support:preference-v14:27.1.0'
  implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  implementation 'com.google.firebase:firebase-auth:11.0.4'
  implementation 'com.google.firebase:firebase-database:11.0.4'
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  implementation 'com.github.ybq:Android-SpinKit:1.1.0'
  compile 'com.thoughtbot:expandablerecyclerview:1.3'
  compile 'com.simplecityapps:recyclerview-fastscroll:1.0.16'
  //compile 'com.jaredrummler:material-spinner:1.2.5'
  //compile ('com.weiwangcn.betterspinner:library:1.1.0') {
  //    exclude group: 'com.android.support', module: 'appcompat-v7'
  //}
  compile 'org.greenrobot:eventbus:3.1.1'
  //implementation 'com.devbrackets.android:exomedia:4.1.0'
  //compile 'com.github.arcadefire:nice-spinner:1.3.1'
  compile 'com.github.ganfra:material-spinner:2.0.0'

  implementation 'com.github.bumptech.glide:glide:4.6.1'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'

  //implementation 'com.google.android.exoplayer:exoplayer:2.6.1'

  implementation project(':exoplayer-library-core')
  implementation project(':exoplayer-library-dash')
  implementation project(':exoplayer-library-ui')
  implementation project(':exoplayer-library-smoothstreaming')
  implementation project(':exoplayer-library-hls')

  compile('com.adincube.sdk:AdinCube-Java-1606ebe:1.+@aar') {
    transitive = true
  }

  //compile 'com.google.firebase:firebase-core:11.0.4'
}








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




,这是我的build.gradle(项目):



// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

  repositories {
    google()
    jcenter()
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.2.1'
  }
}

allprojects {
  repositories {
    google()
    jcenter()
    maven {
      url "https://jitpack.io"
    }

    maven {
      url 'https://maven.google.com'
    }
    maven {
      url 'http://repository.adincube.com/maven'
    }
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}




有没有人遇到过这个?请帮帮我。

1 个答案:

答案 0 :(得分:0)

您对所有相同版本的firebase依赖关系,并确保明确提及google-services-ads依赖项与firebase依赖项具有相同的版本。