這是我的根 build.gradle 檔案
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
當我嘗試運行時,./gradlew :app:compileDebugKotlin我得到了這個:
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.neborosoft.AndroidJniBridgeGenerator:annotations:1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/neborosoft/AndroidJniBridgeGenerator/annotations/1.0/annotations-1.0.pom
- https://repo.maven.apache.org/maven2/com/neborosoft/AndroidJniBridgeGenerator/annotations/1.0/annotations-1.0.pom
- https://jcenter.bintray.com/com/neborosoft/AndroidJniBridgeGenerator/annotations/1.0/annotations-1.0.pom
Required by:
project :app > project :Logic
如您所見,它不會嘗試在本地 Maven 存盤庫中進行搜索。你知道如何解決嗎?
uj5u.com熱心網友回復:
放置您的:
mavenLocal()
在應用程式的 gradle 檔案中
uj5u.com熱心網友回復:
該buildscript子句僅用于決議插件(及其依賴項)。repositories在buildscript像這樣之外添加另一個子句:
buildscript {
repositories {
mavenLocal()
...
}
...
}
repositories {
mavenLocal()
...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/382349.html
