我添加了一个定制的maven存储库来构建.gradle在Android Studio中,但找不到依赖项

Maven存储库和依赖项

<repository>
    <id>achartengine</id>
    <name>Public AChartEngine repository</name>
    <url>https://repository-achartengine.forge.cloudbees.com/snapshot/</url>
</repository>

<dependency>
    <groupId>org.achartengine</groupId>
    <artifactId>achartengine</artifactId>
    <version>1.2.0</version>
</dependency>

建筑格拉德尔

buildscript {
    repositories {
        mavenCentral()
        maven {
            url "https://repository-achartengine.forge.cloudbees.com/snapshot/"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}
apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'
}

android {
    compileSdkVersion 19
    buildToolsVersion "19"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

Android Studio中的错误消息:

A problem occurred configuring root project 'My-MobileAndroid'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':_DebugCompile'.
  > Could not find org.achartengine:achartengine:1.2.0.
    Required by:
        :My-MobileAndroid:unspecified

What am I missing in 建筑格拉德尔?

推荐答案

您将需要在buildscript之外定义存储库.buildscript配置块只为构建脚本的类路径设置存储库和依赖项,而不是应用程序.

Android相关问答推荐

如何在停止和销毁时更改函数中Firebase实时数据库的子项的值我试过了,但这不起作用.请使用Kotlin

Android-交叉引用表中的ForeignKey用于什么?

是否可以附加事件处理程序,如onClick,拖动到Canvas Composable中绘制的内容,或使用drawBehind修饰符?

在 kotlin 上向适配器添加绑定视图功能

React-Native Manifest 合并失败并出现多个错误

Jetpack Compose 使用 SavedStateHandle 发送返回结果不适用于 ViewModel 中注入的 SavedStateHandle

为什么 Android Studio 中的 theme.xml 目录没有任何原色

Material 3的MaterialSwitch默认大小太大了?如何使它变小?

如何在这段代码android jetpack compose中实现全屏滚动

只能从同一个库组内调用成功(引用groupId=androidx.work from groupId=My Composable)

如何从 firebase 实时数据库中检索最后一个值

如何正确地将图像上传到 Jetpack Compose 中的 LazyList 中的项目?

在事件中使用 Context/Toast 时不需要的重组 - Jetpack Compose

如何在 Android 应用程序未激活/未聚焦时显示视图?

错误:构建 react-native 应用程序时包 com.facebook.react.bridge 不存在

房间创建三四表关系

我的 react native 项目的发布签名 apk 没有在设备中打开,而且它创建的尺寸非常小

构成material 3 中的分隔符

如何在stroke android drawable中设置渐变

使用协程访问数据库