添加库Android-studio

Fab*_*193 5 java android android-studio build.gradle

我在我的项目中添加achartengine-1.1.0.jar时遇到了麻烦.当我添加

compile file('libs.achartengine-1.1.0.jar') 
Run Code Online (Sandbox Code Playgroud)

在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.
Run Code Online (Sandbox Code Playgroud)

提前致谢.晶圆厂.

Sof*_*LLC 10

依赖应该读取compile files(...),而不是compile file(...).同样在上面你写道路libs.achartengine-1.1.0.jar,这应该是libs/achartengine-1.1.0.jar.