簡體   English   中英

jitsi 依賴項在 2022 年無法在 android studio 中運行?

[英]jitsi dependency not working in 2022 in android studio?

找不到 org.jitsi.react:jitsi-meet-sdk:7.0.1。 單擊下面代碼后面的鏈接可以查看此錯誤的屏幕截圖

我嘗試將依賴項正確地放入 gradle.build 文件中,但我一直收到此錯誤。 我已經糾結了一個星期

有人可以幫助我在 2022 年如何處理這個問題嗎?

這是項目級別的 gradle.build

 buildscript {
    repositories {
        maven {
            url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
        }
        google()
        mavenCentral()
        maven { url 'https://www.jitpack.io' }
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.14'
    }
}

這是應用程序級別的 gradle.build

plugins {
    id 'com.android.application' version '7.1.0' apply false
    id 'com.android.library' version '7.1.0' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}  
  
  
**Here is gradle.build at app level**
  
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.mlimivirtualmeeting"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'

    //scalable size unit (support for different screen sizes)
    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    implementation 'com.intuit.ssp:ssp-android:1.0.6'

    //RecyclerView
    implementation 'androidx.recyclerview:recyclerview:1.2.1' //1.1.0

    //Material design
    implementation 'com.google.android.material:material:1.7.0' //1.1.0
    //MultiDex
    //implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.android.support:multidex:1.0.3'

    //Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'

    //Swipe refresh layout
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

    //Firebase
    implementation 'com.google.firebase:firebase-messaging:23.1.1' //'com.google.firebase:firebase-messaging:23.1.0'
    implementation 'com.google.firebase:firebase-firestore:24.4.1'

    //jitsi meet
    implementation ('org.jitsi.react:jitsi-meet-sdk:7.0.1') { transitive = true }


}

這是顯示的錯誤

在最新版本的 Android Studio 中,可能無法在build.gradle中找到allprojects{} 在這種情況下,存儲庫進入項目根目錄中的settings.gradle文件(修改settings.gradle中的代碼):

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
        }
        maven {
            url "https://maven.google.com"
        }
    }
}

之后在模塊build.gradle中使用依賴

implementation ('org.jitsi.react:jitsi-meet-sdk:6.2.2') { transitive = true }

您的應用程序適用於 jitsi SDK v6.2.2。

注意: Jitsi SDK v7.0.0 或 v7.0.1 不能簡單地以這種方式工作。 SDK 版本 7.x 似乎與 gradle 版本有關。 要實施 Jitsi SDK v7.x,請先檢查您的 gradle 版本並確保將其設置為 gradle v7.4.2。

如何修復這個項目的 Gradle 版本?

  • 轉到IDE 和項目設置>項目結構>項目
  • Gradle 版本設置為7.4.2

現在同步項目:

implementation ('org.jitsi.react:jitsi-meet-sdk:7.0.1') { transitive = true }

截至 2022 年 12 月 20 日,您已准備好使用最新版本的 Jitsi SDK。

祝你好運!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM