[英]Adding a library Android-studio
我在我的項目中添加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.
提前致謝。 晶圓廠。
依賴項應該讀取compile files(...)
,而不是compile file(...)
。 同樣在上面你將路徑寫為libs.achartengine-1.1.0.jar
,這應該是libs/achartengine-1.1.0.jar
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.