【问题标题】:Adding a library Android-studio添加库 Android-studio
【发布时间】:2013-10-11 04:28:05
【问题描述】:

在我的项目中添加 achartengine-1.1.0.jar 时遇到问题。 当我添加

compile file('libs.achartengine-1.1.0.jar') 

在 build.gradle 中,Gradle 显示以下消息:

Gradle: A problem occurred evaluating project ':NativeCharts'.
Cannot convert the provided notation to an object of type Dependency: /home/***/NativeChartsProject/NativeCharts/libs/achartengine-1.1.0.jar.
  The following types/formats are supported:
    - Instances of Dependency.
    - Strings/CharSequences, e.g. 'org.gradle:gradle-core:1.0'.
    - Maps, e.g. [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, e.g. files('some.jar', 'someOther.jar').
    - Projects, e.g. project(':some:project:path').
    - ClassPathNotation, e.g. gradleApi().
  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

提前致谢。 棒棒哒。

【问题讨论】:

  • 我将文件更改为文件,现在我有了:Gradle:配置项目“:NativeCharts”时出现问题。 > 无法解析配置“:NativeCharts:classpath”的所有依赖项。 > 在端口 50072 上 ping 锁“640513271418860208”的所有者时出现问题

标签: java android android-studio build.gradle


【解决方案1】:

依赖项应该是compile files(...),而不是compile file(...)。同样在上面您将路径写为libs.achartengine-1.1.0.jar,这应该是libs/achartengine-1.1.0.jar

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-21
    • 1970-01-01
    • 1970-01-01
    • 2022-11-18
    • 2013-11-26
    • 2015-12-12
    • 2015-02-16
    相关资源
    最近更新 更多