【问题标题】:Why does adding connectycube to android project fail?为什么将connectycube添加到android项目失败?
【发布时间】:2020-02-03 09:25:43
【问题描述】:

我正在将 Connectycube 源添加到我的 Android 项目中,如下所示:Connectycube Android

按照概述,我对配置进行了以下更改。

  • 整个项目的build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
      ext.kotlin_version = '1.3.61'
      repositories {
         google()
        jcenter()
         maven {
            url "https://github.com/ConnectyCube/connectycube-android-sdk-releases/raw/master/"
        }
     }
    dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
     }
     }
    
    allprojects {
     repositories {
       google()
       jcenter()
       maven {
          url "https://github.com/ConnectyCube/connectycube-android-sdk-releases/raw/master/"
       }
      }
     }
    
        task clean(type: Delete) {
          delete rootProject.buildDir
     }
    
  • 应用程序的build.gradle

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    android {
    compileSdkVersion 28
      defaultConfig {
        applicationId "com.example.app2"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
      }
     buildTypes {
     release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard- rules.pro'
          }
       }
     }
    
      dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.core:core-ktx:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation("com.squareup.okhttp3:okhttp:4.3.1")
        testImplementation("com.squareup.okhttp3:mockwebserver:4.3.1")
        implementation 'com.fasterxml.jackson.core:jackson-core:2.10.2'
        implementation 'com.fasterxml.jackson.core:jackson-annotations:2.10.2'
        implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.2'
        implementation("ru.gildor.coroutines:kotlin-coroutines-okhttp:1.0")
        implementation 'com.github.kittinunf.fuel:fuel:2.2.1' //Core package
        implementation 'com.github.kittinunf.fuel:fuel-android:2.2.1' //Android
        implementation 'com.github.kittinunf.fuel:fuel-gson:2.2.1' //Fuel Gson
        implementation 'com.google.code.gson:gson:2.8.6' //Gson
    
       implementation "com.connectycube:connectycube-android-sdk-chat:1.8.1"
       implementation "com.connectycube:connectycube-android-sdk-videochat:1.8.1"
       implementation "com.connectycube:connectycube-android-sdk-storage:1.8.1"
       implementation "com.connectycube:connectycube-android-sdk-pushnotifications:1.8.1"
    
      testImplementation 'junit:junit:4.13'
      androidTestImplementation 'androidx.test.ext:junit:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
     }
    

项目构建良好。但是,在运行该应用程序时,该应用程序立即崩溃,我现在收到以下错误,而之前它很好:

java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.app2-GGFjPULxWAFkxuGr2o1VpA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.app2-GGFjPULxWAFkxuGr2o1VpA==/lib/x86, /data/app/com.example.app-GGFjPULxWAFkxuGr2o1VpA==/base.apk!/lib/x86, /system/lib, /vendor/lib]]

【问题讨论】:

    标签: android kotlin connectycube


    【解决方案1】:

    使用 Galaxy Nexus API 27 作为模拟器修复了它。显然,Nexus 5x 上的 API 26 无法与它一起工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-19
      • 1970-01-01
      • 1970-01-01
      • 2021-11-30
      • 1970-01-01
      • 2016-08-13
      相关资源
      最近更新 更多