Gradle build is stricter that Eclipse ADT (e.g. Found item _ more than one time)

自闭症网瘾萝莉.ら 提交于 2019-12-09 23:11:18

问题


I am adding second gradle build for Eclipse Android projects.

However I have to fix a lot of smaller issue as Gradle finds additional errors, that Eclipse build does not, like duplicate values:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':FunshionAndroid:mergeDebugResources'.
> D:\Workspaces\Proj\AndroidApp\res\values-hdpi\dimens.xml: Error: Found item Dimension/tvname_textsize more than one time

As my first goal is to finish Gradle build first, how to configure gradle not to validate projects (stricter than Eclipse does)


回答1:


OK, finally there is Lint configuration. So the reason of errors was that Lint is enabled by default for release build (and gradle makes debug and release 2 builds by default)

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

or use gradle assembleDebug debug build only.



来源:https://stackoverflow.com/questions/23946772/gradle-build-is-stricter-that-eclipse-adt-e-g-found-item-more-than-one-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!