有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JAVAlang.NoClassDefFoundError:解析失败:Lcom/google/安卓/gms/common/internal/zzbp;

我正在运行一个安卓 react原生应用程序,一个成功的构建已经完成,但当应用程序启动时,它崩溃了,我甚至无法打开它。我在互联网上找到了多种解决方案,但似乎都不管用。 以下是我的gradle文件:

格雷德尔。应用程序

apply plugin: "com.安卓.application"

import com.安卓.build.OutputFile

project.ext.react = [
        nodeExecutableAndArgs : ["/usr/local/bin/node"]
];

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

def enableProguardInReleaseBuilds = false

安卓 {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId "com.tradeup"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 3
        versionName "1.7"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-安卓.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
}

dependencies {
    compile project(':react-native-fcm')
    compile project(':react-native-code-push')
    compile project(':react-native-image-picker')
    compile project(':react-native-splash-screen')
    compile (project(':react-native-fcm')){
        exclude group: "com.google.firebase"
    }
    compile project(':react-native-svg')
    compile project(':react-native-vector-icons')
    compile project(':react-native-linear-gradient')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.安卓.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  

    compile "com.google.firebase:firebase-core:11.2.0"

    compile "com.google.安卓.gms:play-services-base:11.2.0"

    compile "com.google.firebase:firebase-analytics:11.2.0"
    compile "com.google.firebase:firebase-auth:11.2.0"
    compile "com.google.firebase:firebase-config:11.2.0"
    compile "com.google.firebase:firebase-crash:11.2.0"
    compile "com.google.firebase:firebase-database:11.2.0"
    compile "com.google.firebase:firebase-messaging:11.2.0"
    compile "com.google.firebase:firebase-perf:11.2.0"
    compile "com.google.firebase:firebase-storage:11.2.0"
}

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

我已经尝试解决这个问题一段时间了,ios版本运行良好。谢谢


共 (1) 个答案

  1. # 1 楼答案

    我把这个添加到gradle中,它解决了我的问题

    implementation "com.google.android.gms:play-services-base:15.0.1"
    
    implementation "com.google.android.gms:play-services-gcm:15.0.1"