Android Studio添加Meow Bottom Navigation库构建失败求助
问题
在Android Studio(Java项目)中添加com.etebarian:meow-bottom-navigation:1.3.1库后出现构建错误,此前项目运行正常。
报错信息
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.etebarian:meow-bottom-navigation:1.3.1.
相关配置文件
模块级build.gradle
plugins { id 'com.android.application' id 'com.google.gms.google-services' } android { namespace 'greenline.fpotwotw.poeter' compileSdk 34 defaultConfig { applicationId "greenline.fpotwotw.poeter" minSdk 23 targetSdk 34 versionCode 1 versionName "1.0" 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 } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core:1.10.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' implementation 'androidx.navigation:navigation-fragment:2.7.0' implementation 'androidx.navigation:navigation-ui:2.7.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.3.1' implementation 'androidx.preference:preference:1.2.1' implementation 'androidx.palette:palette:1.0.0' implementation 'com.google.android.material:material:1.9.0' implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0' implementation 'com.google.android.gms:play-services-cast-framework:21.3.0' implementation 'com.google.firebase:firebase-storage:20.2.1' implementation 'com.google.firebase:firebase-messaging:23.2.1' implementation 'com.google.firebase:firebase-database:20.2.2' implementation 'com.google.firebase:firebase-firestore:24.7.0' implementation 'com.google.firebase:firebase-analytics:21.3.0' implementation 'com.google.firebase:firebase-bom:32.2.2' implementation 'com.google.firebase:firebase-auth-ktx:22.1.1' implementation 'com.google.firebase:firebase-auth:22.1.1' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.3' implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.3' //implementation 'com.androidx.palette:palette:1.0.0' implementation 'de.hdodenhof:circleimageview:3.1.0' implementation 'com.android.volley:volley:1.2.1' implementation 'com.github.dhaval2404:imagepicker:2.1' implementation 'com.github.bumptech.glide:glide:4.15.1' implementation 'com.pnikosis:materialish-progress:1.7' implementation "androidx.core:core-splashscreen:1.0.1" implementation "com.squareup.picasso:picasso:2.8" implementation "com.facebook.fresco:fresco:2.3.0" implementation "com.github.skydoves:balloon:1.2.9" implementation "com.hbb20:ccp:2.6.0" implementation 'com.facebook.shimmer:shimmer:0.5.0' implementation 'com.etebarian:meow-bottom-navigation:1.3.1' //implementation "com.mikhaellopez:circularfillableloaders:1.3.2" constraints { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") } implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") } } }
项目级build.gradle
buildscript { dependencies { classpath 'com.google.gms:google-services:4.3.15' } repositories { mavenCentral() } }// Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.application' version '7.3.1' apply false id 'com.android.library' version '7.3.1' apply false }
settings.gradle
pluginManagement { repositories { gradlePluginPortal() google() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url "https://jitpack.io" } } } rootProject.name = "Poeter" include ':app'
解决步骤
- 更新依赖版本:将
meow-bottom-navigation的版本替换为最新可用版本,比如1.3.2(1.3.1版本可能已从仓库移除或不存在),修改模块级build.gradle中的依赖行:implementation 'com.etebarian:meow-bottom-navigation:1.3.2' - 确认仓库配置:确保
settings.gradle的dependencyResolutionManagement中已添加JitPack仓库(你的配置中已包含,可跳过此步):maven { url "https://jitpack.io" } - 清理缓存并同步:
- 点击Android Studio菜单栏的
File -> Invalidate Caches...,勾选Clear file system cache and local history,点击Invalidate and Restart - 重启后点击
Sync Project with Gradle Files按钮重新同步项目
- 点击Android Studio菜单栏的
内容的提问来源于stack exchange,提问作者San Nasser
相关产品推荐
相关产品推荐

