在使用gradle构建项目时,我收到了很多这些警告.我看到/sf/answers/1105625531/,但我不清楚如何沉默这些.这听起来像我依赖的这些东西的任何版本都被剥离出来支持android.jar中打包的版本.
我想这没关系,但我真的想关闭它们,以便我看到的东西只是真正的问题.
所以,具体来说,我很好奇:
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for robolectric as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for robolectric as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.3 is ignored for debugTest as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Run Code Online (Sandbox Code Playgroud)
mar*_*aci 86
我不确定这是否会产生问题.最好的办法是遵循警告中的建议,或完全排除依赖(你的观点#2,我在下面回答).
我也一直在看这些警告,特别是'commons-logging'警告.
您链接的线程中的答案是,您应该忽略这些依赖关系,因为Android API已经包含它们(我认为.如果我错了,请纠正我).
例如,如果您特别要求公共日志记录(或其他提供类似警告的日志记录)将其从列表中删除.
build.gradle文件:
dependencies {
...
compile 'commons-logging:commons-logging:1.1.3' #Remove this line; you don't need it.
....
}
Run Code Online (Sandbox Code Playgroud)
此外,如果您的依赖项需要将commons-logging作为传递依赖项,那么您也应该将其排除.
例:
dependencies {
...
compile 'some.package.that:requires_commons_logging:1.2.3'
....
}
Run Code Online (Sandbox Code Playgroud)
变
dependencies {
...
compile ('some.package.that:requires_commons_logging:1.2.3') {
exclude group: 'commons-logging', module: 'commons-logging'
}
....
}
Run Code Online (Sandbox Code Playgroud)
完全排除它的简单方法可以通过将其添加到build.gradle文件中来完成,而不必在每个依赖项中将其排除:
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}
Run Code Online (Sandbox Code Playgroud)
最后,要查看依赖关系树(并查看每个依赖关系可以自行传输哪些依赖关系,这可能会非常有用),请从项目的根目录使用此命令:
./gradlew :your_module_name:dependencies
Run Code Online (Sandbox Code Playgroud)
Sig*_*ent 10
如果要静默警告,则必须在build.gradle中为每个依赖项添加此警告:
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
Run Code Online (Sandbox Code Playgroud)
这将是 :
dependencies {
...
compile ('some.package.that:requires_commons_logging:1.2.3') {
exclude group: 'commons-logging', module: 'commons-logging'
}
....
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20993 次 |
| 最近记录: |