Error when building with Android Annotations - android

I'm using the guide here to integrate Android Annotations in my Eclipse project (no Maven). I've got the latest ADT running, and tried cleaning my project, double checking build paths and order/export, and turning annotations on and off, but whenever I add the Android Annotations jar to the entries under Java Compiler > Annotation Processing > Factory Path in Eclipse, I get this error:
Error
Mon Jul 15 18:01:05 PDT 2013
Errors running builder 'Java Builder' on project 'Shopping'.
java.lang.NoClassDefFoundError: org/androidannotations/annotations/EActivity
at org.androidannotations.AndroidAnnotationProcessor.getSupportedAnnotationTypes(AndroidAnnotationProcessor.java:601)
at org.eclipse.jdt.internal.compiler.apt.dispatch.ProcessorInfo.<init>(ProcessorInfo.java:58)
at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.discoverNextProcessor(IdeAnnotationProcessorManager.java:94)
at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:116)
at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:114)
at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.androidannotations.annotations.EActivity
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
Anyone have a fix?

You might have copied the wrong of the 2 jars. Please check carefully, where you place the one with and without "api" in the name (as given on the configuration page).
Besides that I guess you have checked all steps from the trouble shooting section.

It turned out to be a bug with my snapshot of Android Annotations. Reverting to the stable 2.7.1 works!

Related

gradlew assembleRelease Fails With java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context

Sidenote - this post is similar (but not identical) to compileReleaseKotlin fails with java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context, but I thought I'd make my own post with more details about my situation in order to get the best feedback possible. Also, I tried all the solutions in that post, and none of them worked.
I am trying to generate an unsigned release APK for my app. To do that, I use the command gradlew assembleRelease.
I get the following error:
Caught an exception trying to connect to Kotlin Daemon
java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.jetbrains.kotlin.gradle.tasks.JarSearchingUtilKt.findToolsJ
ar(jarSearchingUtil.kt:79)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:20)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:14)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etToolsJar(GradleCompilerEnvironment.kt)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etCompilerFullClasspath(GradleCompilerEnvironment.kt:23)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.getDae
monConnection(GradleKotlinCompilerRunner.kt:336)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemon(GradleKotlinCompilerRunner.kt:181)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:156)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:53)
at org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner.runCom
piler(KotlinCompilerRunner.kt:127)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvm
Compiler(GradleKotlinCompilerRunner.kt:108)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:378)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:253)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute
(Tasks.kt:215)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.inv
oke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:7
3)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskActi
on.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreating
TaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecute
r.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachin
gStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.
execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTas
kExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExec
uter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStat
eTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsEx
ecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.
execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskEx
ecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecu
ter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
WithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFai
lures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(Manage
dExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unk
nown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
known Source)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadR
unnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Unknown Source)
Could not perform incremental compilation: Could not connect to Kotlin com
pile daemon
Could not connect to kotlin daemon. Using fallback strategy.
e: java.lang.ClassNotFoundException: com.sun.tools.javac.util.Context
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.jetbrains.kotlin.gradle.tasks.JarSearchingUtilKt.findToolsJ
ar(jarSearchingUtil.kt:79)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:20)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment$t
oolsJar$2.invoke(GradleCompilerEnvironment.kt:14)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etToolsJar(GradleCompilerEnvironment.kt)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment.g
etCompilerFullClasspath(GradleCompilerEnvironment.kt:23)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eOutOfProcess(GradleKotlinCompilerRunner.kt:303)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:171)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compil
eWithDaemonOrFallback(GradleKotlinCompilerRunner.kt:53)
at org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner.runCom
piler(KotlinCompilerRunner.kt:127)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvm
Compiler(GradleKotlinCompilerRunner.kt:108)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:378)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$ko
tlin_gradle_plugin(Tasks.kt:253)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute
(Tasks.kt:215)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.inv
oke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:7
3)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskActi
on.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.
execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecu
ter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreating
TaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecute
r.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachin
gStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.
execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTas
kExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExec
uter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStat
eTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsEx
ecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.
execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskEx
ecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecu
ter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$Runn
ableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.exec
ute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(
DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFi
ringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute
WithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExec
utorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFai
lures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(Manage
dExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unk
nown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
known Source)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadR
unnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Unknown Source)
Here's some more information about my current situation:
I'm using Windows 10.
This is the result of gradlew assembleRelease --scan. It contains a lot of detailed information that could be useful for debugging.
https://scans.gradle.com/s/sohrhovsc676e/
In Android Studio, I went to "File -> Project Structure" and changed my JDK location from
"C:\Program Files\Android\Android Studio\jre" (embedded JDK)
to
"C:\Program Files\Java\jdk1.8.0_172" (JDK 8), which I got from here.
This failed to solve the problem.
I have also added "C:\Program Files\Java\jdk1.8.0_172\bin" to my System Path variable.
I also uploaded my project to Github, incase anyone needs to see it.
https://github.com/vedantroy/recyclerview-test
Also, I previously tried replacing implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" with implementation"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version", but that didn't work either.
Edit 1 -
I tried switching my Build Variant to "release" and then building an APK and that seemed to work. However, I'm not sure if that produces the same result as gradlew assembleRelease
In my case, this started happening after a Java update. It turns out the JRE was updated but the JDK was not.
Try: install the new JDK update, uninstall old versions, and reopen any shell/ps/cmd sessions/windows. It may be necessary to kill existing Gradle daemons but it should be smart enough not to reuse them. Try your build again!

Migration to Gradle plugin v.1.1.2 caused failing lint checks

My team recently decided to use newly announced unit-testing integration in Android studio, which requires upgrading Gradle plugin version to 1.1.0 or higher. But this update caused failing of Lint task for one of our modules, with very weird error. Can anyone give an idea what might be a problem here?
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2459
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getUnannotatedType(TypeSystem.java:82)
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getParameterizedType(TypeSystem.java:138)
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getParameterizedType(TypeSystem.java:172)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createParameterizedType(LookupEnvironment.java:946)
at org.eclipse.jdt.internal.compiler.lookup.Scope$Substitutor.substitute(Scope.java:511)
at org.eclipse.jdt.internal.compiler.lookup.Scope.substitute(Scope.java:435)
at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.superclass(ParameterizedTypeBinding.java:1212)
at com.android.tools.lint.EcjParser$EcjResolvedClass.isSubclassOf(EcjParser.java:1025)
at com.android.tools.lint.checks.CleanupDetector.checkResourceRecycled(CleanupDetector.java:219)
at com.android.tools.lint.checks.CleanupDetector.visitMethod(CleanupDetector.java:180)
at com.android.tools.lint.client.api.JavaVisitor$DelegatingJavaVisitor.visitMethodInvocation(JavaVisitor.java:1314)
at lombok.ast.MethodInvocation.accept(MethodInvocation.java:114)
at lombok.ast.BinaryExpression.accept(BinaryExpression.java:131)
at lombok.ast.ExpressionStatement.accept(ExpressionStatement.java:63)
at lombok.ast.Block.accept(Block.java:106)
at lombok.ast.Try.accept(Try.java:107)
at lombok.ast.Block.accept(Block.java:106)
at lombok.ast.MethodDeclaration.accept(MethodDeclaration.java:240)
at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
at lombok.ast.CompilationUnit.accept(CompilationUnit.java:83)
at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:263)
at com.android.tools.lint.client.api.LintDriver.checkJava(LintDriver.java:1491)
at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:1026)
at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:882)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:433)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:374)
at com.android.tools.lint.LintCliClient.run(LintCliClient.java:130)
at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:112)
at com.android.build.gradle.internal.LintGradleClient$run.call(Unknown Source)
at com.android.build.gradle.tasks.Lint.runLint(Lint.groovy:198)
at com.android.build.gradle.tasks.Lint.this$4$runLint(Lint.groovy)
at com.android.build.gradle.tasks.Lint$this$4$runLint$1.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lintSingleVariant(Lint.groovy:173)
at com.android.build.gradle.tasks.Lint$lintSingleVariant$0.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lint(Lint.groovy:75)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 47 more

How to download android gradle project dependencies to custom folder?

How to download android gradle project dependencies to custom folder?
I cannot save or read *.exe files in my home folder in my work enviroment under Windows (due security reason and corporate policy)
How to resolve exception thrown by gradle when I try to build or import in IDE Android project?
I tried to change Gradle user home, but it didn't help.
Caused by: java.io.FileNotFoundException: \\{my-company-url-for-user-home}\android-sdk-windows\SDK Manager.exe (Access is denied)
at org.rauschig.jarchivelib.IOUtils.copy(IOUtils.java:50)
at org.rauschig.jarchivelib.CommonsArchiver.extract(CommonsArchiver.java:83)
at org.rauschig.jarchivelib.Archiver$extract.call(Unknown Source)
at com.jakewharton.sdkmanager.internal.SdkDownload.download(SdkDownload.groovy:57)
at com.jakewharton.sdkmanager.internal.SdkDownload$download$0.call(Unknown Source)
at com.jakewharton.sdkmanager.internal.Downloader$Real.download(Downloader.groovy:8)
at com.jakewharton.sdkmanager.internal.Downloader$download.call(Unknown Source)
at com.jakewharton.sdkmanager.internal.SdkResolver.downloadSdk(SdkResolver.groovy:95)
at com.jakewharton.sdkmanager.internal.SdkResolver$downloadSdk$1.callCurrent(Unknown Source)
at com.jakewharton.sdkmanager.internal.SdkResolver.resolve(SdkResolver.groovy:87)
at com.jakewharton.sdkmanager.internal.SdkResolver$resolve$0.call(Unknown Source)
at com.jakewharton.sdkmanager.internal.SdkResolver.resolve(SdkResolver.groovy:17)
at com.jakewharton.sdkmanager.internal.SdkResolver$resolve.call(Unknown Source)
at com.jakewharton.sdkmanager.SdkManagerPlugin$_apply_closure1.doCall(SdkManagerPlugin.groovy:27)
at com.jakewharton.sdkmanager.SdkManagerPlugin$_apply_closure1.doCall(SdkManagerPlugin.groovy)
at com.jakewharton.sdkmanager.SdkManagerPlugin.time(SdkManagerPlugin.groovy:45)
at com.jakewharton.sdkmanager.SdkManagerPlugin$time$0.callCurrent(Unknown Source)
at com.jakewharton.sdkmanager.SdkManagerPlugin.apply(SdkManagerPlugin.groovy:26)
at com.jakewharton.sdkmanager.SdkManagerPlugin.apply(SdkManagerPlugin.groovy)
at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:110)
at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:69)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:35)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:117)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:85)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:130)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
at org.gradle.api.Project$apply$2.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
at build_1nbccshuhk647b9aqa26vge5lo.run(C:\Projects\Android\core\build.gradle:1)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 54 more
To gather all the dependencies, you can just “copy” the configuration that represents the dependencies you want.
For example, to copy all the compile time and runtime dependencies you could do something like:
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.runtime
}
you can also use gradle.user.home system property property or --gradle-user-home command line property
I found solution while reading debug logs:
Set up ANDROID_HOME enviroment variable
13:18:32.382 [DEBUG] [com.jakewharton.sdkmanager.internal.SdkResolver] Missing l
ocal.properties.
13:18:32.395 [DEBUG] [com.jakewharton.sdkmanager.internal.SdkResolver] Missing A
NDROID_HOME.
13:18:32.406 [LIFECYCLE] [com.jakewharton.sdkmanager.internal.SdkResolver] Andro
id SDK not found. Downloading...
13:18:32.425 [DEBUG] [com.jakewharton.sdkmanager.internal.SdkDownload] Downloadi
ng SDK from http://dl.google.com/android/android-sdk_r23-windows.zip.

Import a Gradle project into Android project

I'm working on an android Project which i'd like to import another existing project developed with gradle. So, i've got successfully integrated that gradle project inside Eclipse. I've imported the gradle project and i can see and instantiate the classes from the gradle project, but when i launch the android project it throws the next log by the console:
[2014-10-06 09:10:42 - Pdf2jpg-V3] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:665)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:188)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:786)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:597)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:328)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:403)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1143)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:155)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:883)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
...while parsing simple/escp/Template.class
[2014-10-06 09:10:43 - Pdf2jpg-V3] Dx 1 error; aborting
[2014-10-06 09:10:43 - Pdf2jpg-V3] Conversion to Dalvik format failed with error 1
To import the gradle project to my android project i tried in two ways:
1- Exporting a JAR from the gradle project and importing as external jar and checking it with the build path
2- adding the whole gradle project to the build path from the android project.
Both throws the same exception.
Finally the problem was the compliance level in the Gradle proeject (1.8), so, i updated the project to 1.6 (like my android project) and also updated the instances that were working only in 1.8 to be now working in 1.6.
My problem now is that it seems that the jar references included in the gradle project are not working, but in fact theay are included are gradle references as below:
So, the execution throws class not found exception:
java.lang.NoClassDefFoundError: javax.json.JsonObject
...Though javax.json is included, any idea??

LIBGDX HTML runtime error but works on android and desktop

I'm having an issue where my game compiles to android and desktop but is getting a runtime error saying it can't find any of the files in the package walljumper.tools. It gets all the way to the loading screen, loads and then says this in the browser
GwtApplication: exception: walljumper/tools/Assets
walljumper/tools/Assets
and says this in the console
java.lang.NoClassDefFoundError: walljumper/tools/Assets
at com.me.walljumper.WallJumper.create(WallJumper.java:23)
at com.badlogic.gdx.backends.gwt.GwtApplication.setupLoop(GwtApplication.java:177)
at com.badlogic.gdx.backends.gwt.GwtApplication$1$1.update(GwtApplication.java:138)
at com.badlogic.gdx.backends.gwt.preloader.Preloader$1$1.onSuccess(Preloader.java:184)
at com.badlogic.gdx.backends.gwt.preloader.AssetDownloader$4$1.onEvent(AssetDownloader.java:171)
at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: walljumper.tools.Assets
at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1090)
at com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1196)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 15 more
Thanks in advance
In your Something.gwt.xml in your shared project do you correctly list the translatable source packages?
<module>
<source path="walljumper/" />
</module>

Categories

Resources