Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to recreate a file for type com.raizlabs.android.dbflow.config.MyDatabase$Database #176

Closed
mathieudebrito opened this issue Mar 31, 2015 · 16 comments

Comments

@mathieudebrito
Copy link
Contributor

Hi guys,

Is it normal that I get this error-warning each time I compile ? (the build still works)

javax.annotation.processing.FilerException: Attempt to recreate a file for type com.raizlabs.android.dbflow.config.GeoveloDbFlowDatabase$Database
    at com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:522)
    at com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:396)
    at com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:378)
    at com.raizlabs.android.dbflow.processor.model.ProcessorManager.handle(ProcessorManager.java:277)
    at com.raizlabs.android.dbflow.processor.DBFlowProcessor.process(DBFlowProcessor.java:94)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$200(JavacProcessingEnvironment.java:97)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.runContributingProcs(JavacProcessingEnvironment.java:644)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1027)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1185)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
    at com.sun.tools.javac.main.Main.compile(Main.java:439)
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:42)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:35)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
    at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:138)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:235)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:222)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
warning: File for type 'com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
@agrosner
Copy link
Owner

agrosner commented Apr 1, 2015

it happens from time to time, but its not a problem.

@agrosner agrosner closed this as completed Apr 1, 2015
@mathieudebrito
Copy link
Contributor Author

Ok, but it's not time to time, it's at every compile (tried on more than 30+ compile)
And I'm using Android Annotations + Dagger (apt power)

@Rainer-Lang
Copy link

Same for me. I'm also using Android Annotations.

@sergii-frost
Copy link

Same for me. It is not blocking build, but not good to see it there.

@fabiendem
Copy link

Hey guys running into the same issue.

@agrosner I noticed that there is a e.printStackTrace() in https://github.com/Raizlabs/DBFlow/blob/324a8d2f4d8ab282add03774b48d9ebd9f600b26/compiler/src/main/java/com/raizlabs/android/dbflow/processor/model/ProcessorManager.java#L297

Looks like it's coming from there and bubbles up to the gradle build.
I am not sure what exactly is happening is this piece of code, but maybe the exception should not be printed?

@glureau
Copy link
Contributor

glureau commented Aug 26, 2015

Same for me. Looks like the processor are called several times during the build (first pass create the files, others write warnings because already generated files). Could be related to the debug/release build or variants?

@teddis
Copy link

teddis commented Oct 29, 2015

Why was this closed? It's still a problem (for me) with latest 2.2.1 release.

@jonathanrz
Copy link

My build is very slow (+ than 2 minutes for incremental builds) and I believe that this is the cause of the slow build.
Someone had found some way to avoid this?

In the issue #107 this was caused by a bug in the table definitions.

@mathieudebrito
Copy link
Contributor Author

Same here, and if I remove DBFlow, build times gets back to normal.
I didn't find any workaround for it, I just got used to it since DBFlow is by far (for now) the best database ORM I've got to try (And I've tried some...) :p

@AntonioCappiello
Copy link

+1

@DanChaltiel
Copy link

This message happens only if I have ButterKnife implemented in my app together with DBFlow :

:app:compileDebugJavaWithJavac
warning: Attempt to recreate a file for type com.raizlabs.android.dbflow.config.LIFE_DATABASE$Database
warning: Attempt to recreate a file for type com.raizlabs.android.dbflow.config.LIFE_DATABASE$Database
warning: File for type 'com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings

It vanish as soon as I remove it, but as said before it is not really a problem

@aotian16
Copy link

Run into same issue.
How to fix this?

@abhimuktheeswarar
Copy link

Still no fix ?

@Sateesh2
Copy link

Sateesh2 commented Jan 9, 2017

Still happening

@sk3llo
Copy link

sk3llo commented Dec 4, 2017

.\gradlew clean in terminal worked for me

@astubbs
Copy link

astubbs commented Apr 29, 2020

This could be related to this old dagger issue: google/dagger#442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests