1

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)

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • Do you have a dimensions called `tvname_textsize` defined in values-hdpi\dimens.xml more than once? – Bryan Herbst Jun 06 '14 at 14:11
  • Of course. And not only this duplicate, as the project is old and duplicates where not checked before. However after spending 30 minutes fixing those tiny issues, I raise question here on Stackoverflow as there should be way to make Gradle build be not stricter than ADT build – Paul Verest Jun 09 '14 at 02:46
  • Eclipse and ANT builds checked for duplicates as far back as I can remember. How do you propose that the build tools reconcile the conflicting dimensions? Just randomly pick one dimension and use that one? – Bryan Herbst Jun 09 '14 at 13:39
  • I have no proposals. What is dimension here? Please add answer with some details. – Paul Verest Jun 10 '14 at 02:31
  • 1
    I don't have an answer because I'm not sure it's possible. When I say conflicting dimensions I am referring to the duplicate items in your dimens.xml files. If I define a dimension called `item_width` twice in the same file with two different values, I *want* the build tools to complain instead of just picking one. – Bryan Herbst Jun 10 '14 at 02:51
  • Not possible is also answer. I agree that checking duplicates during build is better. The problem is to get build similar with Eclipse ADT. (Or ADT similar with gradle) – Paul Verest Jun 10 '14 at 07:10

1 Answers1

2

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.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332