Lint fails when builing Android Studio project with gradle -


i'm using gradle build android studio project:

$ ./gradlew build 

when process reach 94%, got following error:

--------------------------------------------- :lint failed  failure: build failed exception.  * went wrong: execution failed task ':lint'. > string index out of range: -2 ---------------------------------------------  re-run build --stacktrace, got exception stack:  -------------------  * went wrong: execution failed task ':lint'. > string index out of range: -2  * try: run --info or --debug option more log output.  * exception is: org.gradle.api.tasks.taskexecutionexception: execution failed task ':lint'.     @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeactions(executeactionstaskexecuter.java:69)     @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.execute(executeactionstaskexecuter.java:46)     @ org.gradle.api.internal.tasks.execution.postexecutionanalysistaskexecuter.execute(postexecutionanalysistaskexecuter.java:35)     @ org.gradle.api.internal.tasks.execution.skipuptodatetaskexecuter.execute(skipuptodatetaskexecuter.java:64)     @ org.gradle.api.internal.tasks.execution.validatingtaskexecuter.execute(validatingtaskexecuter.java:58)     @ org.gradle.api.internal.tasks.execution.skipemptysourcefilestaskexecuter.execute(skipemptysourcefilestaskexecuter.java:42)     @ org.gradle.api.internal.tasks.execution.skiptaskwithnoactionsexecuter.execute(skiptaskwithnoactionsexecuter.java:52)     @ org.gradle.api.internal.tasks.execution.skiponlyiftaskexecuter.execute(skiponlyiftaskexecuter.java:53)     @ org.gradle.api.internal.tasks.execution.executeatmostoncetaskexecuter.execute(executeatmostoncetaskexecuter.java:43)     @ org.gradle.api.internal.abstracttask.executewithoutthrowingtaskfailure(abstracttask.java:305)     @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.executetask(abstracttaskplanexecutor.java:79)     @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.processtask(abstracttaskplanexecutor.java:63)     @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.run(abstracttaskplanexecutor.java:51)     @ org.gradle.execution.taskgraph.defaulttaskplanexecutor.process(defaulttaskplanexecutor.java:23)     @ org.gradle.execution.taskgraph.defaulttaskgraphexecuter.execute(defaulttaskgraphexecuter.java:88)     @ org.gradle.execution.selectedtaskexecutionaction.execute(selectedtaskexecutionaction.java:29)     @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:62)     @ org.gradle.execution.defaultbuildexecuter.access$200(defaultbuildexecuter.java:23)     @ org.gradle.execution.defaultbuildexecuter$2.proceed(defaultbuildexecuter.java:68)     @ org.gradle.execution.dryrunbuildexecutionaction.execute(dryrunbuildexecutionaction.java:32)     @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:62)     @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:55)     @ org.gradle.initialization.defaultgradlelauncher.dobuildstages(defaultgradlelauncher.java:149)     @ org.gradle.initialization.defaultgradlelauncher.dobuild(defaultgradlelauncher.java:106)     @ org.gradle.initialization.defaultgradlelauncher.run(defaultgradlelauncher.java:86)     @ org.gradle.launcher.exec.inprocessbuildactionexecuter$defaultbuildcontroller.run(inprocessbuildactionexecuter.java:80)     @ org.gradle.launcher.cli.executebuildaction.run(executebuildaction.java:33)     @ org.gradle.launcher.cli.executebuildaction.run(executebuildaction.java:24)     @ org.gradle.launcher.exec.inprocessbuildactionexecuter.execute(inprocessbuildactionexecuter.java:36)     @ org.gradle.launcher.exec.inprocessbuildactionexecuter.execute(inprocessbuildactionexecuter.java:26)     @ org.gradle.launcher.cli.runbuildaction.run(runbuildaction.java:51)     @ org.gradle.internal.actions$runnableactionadapter.execute(actions.java:171)     @ org.gradle.launcher.cli.commandlineactionfactory$parseandbuildaction.execute(commandlineactionfactory.java:237)     @ org.gradle.launcher.cli.commandlineactionfactory$parseandbuildaction.execute(commandlineactionfactory.java:210)     @ org.gradle.launcher.cli.javaruntimevalidationaction.execute(javaruntimevalidationaction.java:35)     @ org.gradle.launcher.cli.javaruntimevalidationaction.execute(javaruntimevalidationaction.java:24)     @ org.gradle.launcher.cli.commandlineactionfactory$withlogging.execute(commandlineactionfactory.java:206)     @ org.gradle.launcher.cli.commandlineactionfactory$withlogging.execute(commandlineactionfactory.java:169)     @ org.gradle.launcher.cli.exceptionreportingaction.execute(exceptionreportingaction.java:33)     @ org.gradle.launcher.cli.exceptionreportingaction.execute(exceptionreportingaction.java:22)     @ org.gradle.launcher.main.doaction(main.java:33)     @ org.gradle.launcher.bootstrap.entrypoint.run(entrypoint.java:45)     @ org.gradle.launcher.bootstrap.processbootstrap.runnoexit(processbootstrap.java:54)     @ org.gradle.launcher.bootstrap.processbootstrap.run(processbootstrap.java:35)     @ org.gradle.launcher.gradlemain.main(gradlemain.java:23)     @ org.gradle.wrapper.bootstrapmainstarter.start(bootstrapmainstarter.java:30)     @ org.gradle.wrapper.wrapperexecutor.execute(wrapperexecutor.java:127)     @ org.gradle.wrapper.gradlewrappermain.main(gradlewrappermain.java:58) caused by: java.lang.stringindexoutofboundsexception: string index out of range: -2     @ com.android.tools.lint.checks.typolookup.writedatabase(typolookup.java:321)     @ com.android.tools.lint.checks.typolookup.createcache(typolookup.java:210)     @ com.android.tools.lint.checks.typolookup.get(typolookup.java:176)     @ com.android.tools.lint.checks.typolookup.get(typolookup.java:124)     @ com.android.tools.lint.checks.typodetector.beforecheckfile(typodetector.java:212)     @ com.android.tools.lint.client.api.resourcevisitor.visitfile(resourcevisitor.java:149)     @ com.android.tools.lint.client.api.lintdriver.checkresourcefolder(lintdriver.java:1869)     @ com.android.tools.lint.client.api.lintdriver.checkresfolder(lintdriver.java:1818)     @ com.android.tools.lint.client.api.lintdriver.runfiledetectors(lintdriver.java:1010)     @ com.android.tools.lint.client.api.lintdriver.checkproject(lintdriver.java:888)     @ com.android.tools.lint.client.api.lintdriver.analyze(lintdriver.java:439)     @ com.android.tools.lint.client.api.lintdriver.analyze(lintdriver.java:382)     @ com.android.tools.lint.lintcliclient.run(lintcliclient.java:115)     @ com.android.build.gradle.internal.lintgradleclient.run(lintgradleclient.java:117)     @ com.android.build.gradle.internal.lintgradleclient$run.call(unknown source)     @ com.android.build.gradle.tasks.lint.runlint(lint.groovy:190)     @ com.android.build.gradle.tasks.lint.this$4$runlint(lint.groovy)     @ com.android.build.gradle.tasks.lint$this$4$runlint$3.callcurrent(unknown source)     @ com.android.build.gradle.tasks.lint.lintallvariants(lint.groovy:79)     @ com.android.build.gradle.tasks.lint$lintallvariants$2.callcurrent(unknown source)     @ com.android.build.gradle.tasks.lint.lint(lint.groovy:67)     @ org.gradle.internal.reflect.javamethod.invoke(javamethod.java:63)     @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.doexecute(annotationprocessingtaskfactory.java:218)     @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.execute(annotationprocessingtaskfactory.java:211)     @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.execute(annotationprocessingtaskfactory.java:200)     @ org.gradle.api.internal.abstracttask$taskactionwrapper.execute(abstracttask.java:579)     @ org.gradle.api.internal.abstracttask$taskactionwrapper.execute(abstracttask.java:562)     @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeaction(executeactionstaskexecuter.java:80)     @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeactions(executeactionstaskexecuter.java:61)     ... 47 more  ------------------- 

this cannot avoided following:

lintoptions {         abortonerror false } 

and looks more problem environment.

please me.

thanks.

this bug on version 1.3.0 of android gradle plugin, it's fixed on version 1.3.1 (see https://code.google.com/p/android/issues/detail?id=181820), update project's build.gradle to:

buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.3.1'     } } 

Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -