2013-10-04 34 views
5

Tôi gặp sự cố khi thêm achartengine-1.1.0.jar vào dự án của mình. Khi tôi thêmThêm thư viện Android-studio

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

trong build.gradle, Gradle hiển thị thông báo sau:

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. 

Cảm ơn trước. Fab.

+0

tôi thay đổi tệp thành tệp và bây giờ tôi có: Gradle: Đã xảy ra sự cố khi định cấu hình dự án ': NativeCharts'. > Không thể giải quyết tất cả các phụ thuộc cho cấu hình ': NativeCharts: classpath'. > Sự cố khi ping chủ sở hữu khóa '640513271418860208' tại cổng: 50072 – Fabr9193

Trả lời

9

Phụ thuộc phải đọc compile files(...), không phải compile file(...). Ngoài ra, ở trên, bạn viết đường dẫn là libs.achartengine-1.1.0.jar, điều này phải là libs/achartengine-1.1.0.jar.

+0

Cảm ơn bạn đã chỉ ra lỗi đánh máy và lưu ngày của tôi: P – MohanRaj

Các vấn đề liên quan