java.lang.NoSuchMethodError:没有静态方法zzgs(Ljava / lang / String;)类Lcom / google / android / gms / common / util / zzu中的Z;

时间:2018-03-30 10:56:38

标签: android firebase react-native

我正在使用react-native,firebase开发我的android应用程序。 当我执行它时,应用程序终止,发生错误,如下所示。它工作得很好,直到上周没有任何变化。该应用程序已成功构建,但我无法运行它,这很奇怪。 请让我知道如何处理它。

E/AndroidRuntime: FATAL EXCEPTION: main
Process: exchange.sovereignwallet.mui, PID: 27019
  java.lang.NoSuchMethodError: No static method zzgs(Ljava/lang/String;)Z in class Lcom/google/android/gms/common/util/zzu; or its super classes (declaration of 'com.google.android.gms.common.util.zzu' appears in /data/app/exchange.sovereignwallet.mui-1/base.apk)
      at com.google.firebase.FirebaseOptions.<init>(Unknown Source)
      at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
      at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
      at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
      at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
      at android.app.ActivityThread.installProvider(ActivityThread.java:6326)
      at android.app.ActivityThread.installContentProviders(ActivityThread.java:5918)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5857)
      at android.app.ActivityThread.-wrap3(ActivityThread.java)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:154)
      at android.app.ActivityThread.main(ActivityThread.java:6682)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

这是我的app.gradle

apply plugin: "com.android.application"
apply plugin: "dexguard"

import com.android.build.OutputFile

project.ext.react = [
        entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

repositories{
    flatDir { dirs 'libs' }
}

android {
    compileSdkVersion 23
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "***"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "0.4.1"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        multiDexEnabled true
        signingConfig signingConfigs.mySignature
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        debug {
            proguardFile getDefaultDexGuardFile('dexguard-debug.pro')
            proguardFile 'dexguard-project.txt'
            //proguardFile 'dexguard-project-debug.txt'
            proguardFile 'proguard-project.txt'
        }
        release {
            proguardFile getDefaultDexGuardFile('dexguard-release-aggressive.pro')
            proguardFile 'dexguard-project.txt'
            //proguardFile 'dexguard-project-release.txt'
            proguardFile 'proguard-project.txt'
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def versionCodes = ["armeabi-v7a": 1, "x86": 2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-text-input-reset')
    compile(project(':react-native-camera')) {
        exclude group: "com.google.android.gms"
    }
    compile project(':react-native-device-info')
    compile project(':react-native-i18n')
    compile project(':react-native-image-picker')
    compile project(':react-native-photo-view')
    compile project(':react-native-vector-icons')
    compile project(':react-native-udp')
    compile project(':react-native-tcp')
    compile project(':react-native-randombytes')
    compile project(':react-native-os')
    compile(project(':react-native-firebase')) {
        transitive = false
    }
    compile project(':react-native-fetch-blob')
    compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules

    compile "com.google.android.gms:play-services-base:11.8.0"
    compile 'com.google.android.gms:play-services-maps:11.8.0'
    compile "com.google.firebase:firebase-core:11.8.0"
    compile "com.google.firebase:firebase-auth:11.8.0"
    compile "com.google.firebase:firebase-messaging:11.8.0"
    compile "com.google.firebase:firebase-database:11.8.0"
    compile "com.google.firebase:firebase-storage:11.8.0"
    compile "com.google.android.gms:play-services-vision:11.8.0"
    compile 'me.leolin:ShortcutBadger:1.1.18@aar'
    compile 'com.android.support:multidex:1.0.1'

    compile(name: 'dexguard-runtime', ext: 'aar')
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

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

0 个答案:

没有答案