這是一個非常簡單的問題,我想RealmRecyclerViewAdapter在我的專案中使用這個庫,但是當我嘗試mavenCentral()在我的依賴項上使用它時,我收到了這個錯誤:
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find io.realm:android-adapters:3.1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
- https://repo.maven.apache.org/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
Required by:
project :app
但是,如果我只是使用jcenter()它就可以正常作業。
我正在我的模塊 gradle 檔案中更改它:
repositories{
jcenter()
//mavenCentral()
}
有沒有辦法使用 mavenCentral() 匯入它?
uj5u.com熱心網友回復:
我有一種方法可以幫助您通過jitpack.io存盤庫獲取此庫。首先,repositories {}像這樣在塊中添加存盤庫:
repositories {
...
maven { url 'https://jitpack.io' }
}
然后像這樣添加依賴項:
dependencies {
implementation 'com.github.realm:realm-android-adapters:v3.1.0'
}
uj5u.com熱心網友回復:
不,沒有辦法,因為它甚至無法在 mavenCentral() 上使用。
正如你可以看到這里的注釋部分
注意:此工件位于 Realm 存盤庫 ( https://dl.bintray.com/realm/maven/ )
所以你需要做的是以下
maven {
url "https://dl.bintray.com/realm/maven/"
}
這樣它應該可以訪問而無需 jcenter()
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/355920.html
標籤:安卓 等级 领域 中心 maven-central
