[英]What has useLibrary changed to in gradle experimental 0.6.0-alpha1?
I am trying to port my gradle.build over to gradle experimental. 我正在尝试将我的gradle.build移植到gradle实验中。 I have modified my existing android configuration over as below: 我修改了我现有的Android配置,如下所示:
android {
compileSdkVersion = compileSdk
buildToolsVersion = buildTools
useLibrary "org.apache.http.legacy"
defaultConfig.with {
minSdkVersion.apiLevel = 13
targetSdkVersion.apiLevel = compileSdk
versionName = fullVersion
multiDexEnabled = true
}
}
However, upon compiling, I seem to get the error: 但是,在编译时,我似乎得到了错误:
Error:(148, 1) A problem occurred configuring root project.> Exception thrown while executing model rule:model.android @ build.gradle line 145, column 1> Could not find method useLibrary() for arguments [org.apache.http.legacy] on root project 错误:(148,1)配置根项目时出现问题。>执行模型规则时抛出异常:model.android @ build.gradle第145行,第1列>无法为参数找到方法useLibrary()[org.apache.http .legacy]在根项目上
Probably since I am unsure what has useLibrary
been modified to. 可能因为我不确定useLibrary
被修改为什么。 If I comment this out, the build goes on for a significant till it fails to find the http methods it might be expecting from the above library. 如果我对此进行评论,那么构建会继续进行,直到它找不到上面库可能期望的http方法。 Can someone please provide some pointers on how do I got about including this library in gradle experimental? 有人可以提供一些指示,说明我如何在gradle实验中包含这个库?
This should work to use "org.apache.http.legacy" both regular gradle and gradle-experimental 这应该可以使用“org.apache.http.legacy”常规gradle和gradle-experimental
Remove the useLibrary line: 删除useLibrary行:
useLibrary "org.apache.http.legacy"
Add to gradle(module): 添加到gradle(模块):
dependencies {
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
Hope not too late. 希望不要太晚。 Put org.apache.http.legacy.jar file under libs folder... And include this in your dependencies 将org.apache.http.legacy.jar文件放在libs文件夹下...并在依赖项中包含它
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.