2022年Android Studio中Jitsi依赖加载失败求助
配置Jitsi Meet SDK 7.0.1时遇到依赖找不到的问题(2022年Android Studio环境)
在2022年的Android Studio环境中配置Jitsi Meet SDK时,出现错误提示:
Could not find org.jitsi.react:jitsi-meet-sdk:7.0.1
已尝试配置gradle.build文件,但该问题已持续一周。错误截图:显示依赖查找失败的提示信息。
项目级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' } } 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 }
应用级gradle.build代码
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 } }
解决方法(2022年适用)
补全项目级gradle的仓库配置
当前项目级gradle仅在buildscript中配置了Jitsi仓库,但依赖查找需要在allprojects块中也添加该仓库。修改项目级gradle,添加:allprojects { repositories { maven { url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases" } google() mavenCentral() maven { url 'https://www.jitpack.io' } } }替换Multidex依赖为AndroidX版本
项目中混用了旧的support库和AndroidX库,可能导致依赖冲突。将Multidex依赖替换为:implementation 'androidx.multidex:multidex:2.0.1'同时确保
defaultConfig中的multiDexEnabled true保留。清理Gradle缓存并同步项目
- 点击Android Studio顶部菜单栏的
File->Invalidate Caches... - 勾选
Clear file system cache and local history,点击Invalidate and Restart - 重启后点击
Sync Project with Gradle Files按钮重新同步
- 点击Android Studio顶部菜单栏的
确认SDK版本可用性
Jitsi Meet SDK 7.0.1确实存在于官方仓库中,若上述步骤无效,可尝试临时降级到7.0.0版本测试,确认是否为版本索引问题:implementation ('org.jitsi.react:jitsi-meet-sdk:7.0.0') { transitive = true }
内容的提问来源于stack exchange,提问作者Andrew Chiusiwa
相关产品推荐
相关产品推荐

