Closed Trellian closed 8 years ago
Could you post the full stack trace? javax.annotation.processing.Filer could potentially be in conflict with another preprocessor such as dagger1 or butter knife.
I did have ButterKnife included, as per your sample app. I have now removed it, but the result is the same.
Here is the stack trace:
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.NullPointerException
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69 ) 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.ja va:52) 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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:
203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java: 185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java :66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151) at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99) at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:9 4) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.j ava:51) at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.j ava:28) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: java.lang.RuntimeException: java.lang.NullPointerException at com.sun.tools.javac.main.Main.compile(Main.java:553) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:46) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:1 04) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:163) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:145) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93) at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(Annotati onProcessingTaskFactory.java:244) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationPro cessingTaskFactory.java:220) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(Annotation ProcessingTaskFactory.java:231) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationPro cessingTaskFactory.java:209) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61
)
... 60 more
Caused by: java.lang.NullPointerException
at com.memtrip.sqlking.preprocessor.processor.model.Column.assembleIsIndex(Column.java:60)
at com.memtrip.sqlking.preprocessor.processor.model.Column.
BUILD FAILED
I hope this helps.
and my module build.gradle file:
apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt'
android { compileSdkVersion 23 buildToolsVersion '23.0.3' defaultConfig { applicationId "com.thorburn.sanscan" minSdkVersion 17 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // dexOptions { // javaMaxHeapSize "4g" //specify the heap size for the dex process // preDexLibraries false // } productFlavors { } }
dependencies { testCompile 'junit:junit:4.12' compile files('libs/gson-2.4.jar') compile 'com.android.support:appcompat-v7:23.3.0' compile 'net.zetetic:android-database-sqlcipher:3.3.1-2' compile 'com.google.android.gms:play-services:8.4.0' compile 'com.android.support:design:23.3.0' compile 'com.android.support:support-v4:23.3.0' compile 'com.neenbedankt.gradle.plugins:android-apt:1.4' compile 'org.glassfish:javax.annotation:10.0-b28' apt 'com.memtrip.sqlking:preprocessor:1.0' compile 'com.memtrip.sqlking:client:1.0' compile 'joda-time:joda-time:2.9.3' // compile 'com.jakewharton:butterknife:8.0.1' // apt 'com.jakewharton:butterknife-compiler:8.0.1' compile 'com.android.support:recyclerview-v7:23.3.0' }
and my dependency list:
Executing tasks: [androidDependencies]
Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app:androidDependencies debug +--- LOCAL: gson-2.4.jar +--- com.android.support:appcompat-v7:23.3.0 | +--- com.android.support:support-vector-drawable:23.3.0 | | --- com.android.support:support-v4:23.3.0 | | --- LOCAL: internal_impl-23.3.0.jar | +--- com.android.support:animated-vector-drawable:23.3.0 | | --- com.android.support:support-vector-drawable:23.3.0 | | --- com.android.support:support-v4:23.3.0 | | --- LOCAL: internal_impl-23.3.0.jar | --- com.android.support:support-v4:23.3.0 | --- LOCAL: internal_impl-23.3.0.jar +--- net.zetetic:android-database-sqlcipher:3.3.1-2 +--- com.android.support:design:23.3.0 | +--- com.android.support:appcompat-v7:23.3.0 | | +--- com.android.support:support-vector-drawable:23.3.0 | | | --- com.android.support:support-v4:23.3.0 | | | --- LOCAL: internal_impl-23.3.0.jar | | +--- com.android.support:animated-vector-drawable:23.3.0 | | | --- com.android.support:support-vector-drawable:23.3.0 | | | --- com.android.support:support-v4:23.3.0 | | | --- LOCAL: internal_impl-23.3.0.jar | | --- com.android.support:support-v4:23.3.0 | | --- LOCAL: internal_impl-23.3.0.jar | +--- com.android.support:support-v4:23.3.0 | | --- LOCAL: internal_impl-23.3.0.jar | --- com.android.support:recyclerview-v7:23.3.0 | --- com.android.support:support-v4:23.3.0 | --- LOCAL: internal_impl-23.3.0.jar +--- com.android.support:support-v4:23.3.0 | --- LOCAL: internal_impl-23.3.0.jar +--- com.memtrip.sqlking:client:1.0 | --- io.reactivex:rxandroid:1.1.0 +--- com.android.support:recyclerview-v7:23.3.0 | --- com.android.support:support-v4:23.3.0 | --- LOCAL: internal_impl-23.3.0.jar --- com.google.android.gms:play-services-vision:8.4.0 --- com.google.android.gms:play-services-base:8.4.0 --- com.google.android.gms:play-services-basement:8.4.0 --- com.android.support:support-v4:23.3.0 --- LOCAL: internal_impl-23.3.0.jar
Are you using indexes with your columns? Indexes aren't fully supported at the moment, if you have a requirement I can implement them properly tonight and make a release. Sorry about that.
No, not at all.
Here is a sample of a table, they all follow the same rules:
package com.thorburn.sanscan.scanDB;
import android.os.Parcel; import android.os.Parcelable;
import com.memtrip.sqlking.common.Column; import com.memtrip.sqlking.common.Table;
@Table public class tblLocationextends ScanTableBaseimplements Parcelable { @Column E_LOCATION_TYPElocation_type; @Column Stringlocation; @Column int radius;// meters @Column int parent_location_fk;
public E_LOCATION_TYPE getLocation_type ()
{
return location_type;
}
public void setLocation_type (E_LOCATION_TYPE location_type)
{
this.location_type = location_type;
}
public String getLocation ()
{
return location;
}
public void setLocation (String location)
{
this.location = location;
}
public int getRadius ()
{
return radius;
}
public void setRadius (int radius)
{
this.radius = radius;
}
public int getParent_location_fk ()
{
return parent_location_fk;
}
public void setParent_location_fk (int parent_location_fk)
{
this.parent_location_fk = parent_location_fk;
}
But the problem is that the compile fails in C:\PROJECTS\SANScan\app\src\main\java\com\memtrip\sqlking\preprocessor\processor\Context.java, at line 3:
import javax.annotation.processing.Filer;
with the following error:
Error:(3, 35) error: package javax.annotation.processing does not exist
I have tried pulling in javax as a library or dependency from several sources, but it doesn't help. I'm running Android Studio 2.1.1, with JDK 1.8.0_74.
Any ideas?
Thanks, Adrian
On 02 Jun 2016 18:11, Samuel Kirton wrote:
Are you using indexes with your columns?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/memtrip/SQLKing/issues/2#issuecomment-223341047, or mute the thread https://github.com/notifications/unsubscribe/ABCOrBxNl7vL7Fbu_YS5bZRahUTism9Cks5qHwCVgaJpZM4IsZT5.
Hi Adrian,
The library doesn't support Enums at the moment.
Cheers, Sam
Hi Sam,
I've removed all my enums, and reverted back to 'int' type, but still the same problem. Help!
Thanks, Adrian
Also, in C:\PROJECTS\Thorburn\projects\SANScan\app\src\main\java\com\memtrip\sqlking\preprocessor\processor\Processor.java, The same errors show (see image below). Which implementation of javax.* code are you using?
I tried to reproduce your bug and it looks like it is caused by the lower case class name, could you use "TblLocationextends" instead of "tblLocationextends" and try again? There is an assumption that Java classes start with a capital. I will add this to the documentation for now and fix the bug in the next release.
Also, open the preprocessor project using Intellj or run it with mvn clean install
I just refactored all the tables to start with a capital letter. I'm still getting exactly the same error. Trying the Intellij option now
Caused by: java.lang.NullPointerException at com.memtrip.sqlking.preprocessor.processor.model.Column.assembleIsIndex(Column.java:60) at com.memtrip.sqlking.preprocessor.processor.model.Column.(Column.java:42) at com.memtrip.sqlking.preprocessor.processor.model.Table.assembleMembers(Table.java:57) at com.memtrip.sqlking.preprocessor.processor.model.Table.(Table.java:37) at com.memtrip.sqlking.preprocessor.processor.model.Data.assembleTables(Data.java:24) at com.memtrip.sqlking.preprocessor.processor.model.Data.(Data.java:16) at com.memtrip.sqlking.preprocessor.processor.Processor.process(Processor.java:40)
Ok I think one of your private member variables is not annotated with @Column? I have fixed the bug and I will deploy a new version to maven central tonight. When working with ORMs its good practise for the model classes to be a pure reflection of the database table, as such, I would not expect there to be members variables that are not be annotated with @Column.
Thanks, I'll give it a shot!
Hi Sam,
Thank you very much for your help so far, I really appreciate it, especially that you find the time to help out so fast.
I re-imported the module, and the "error: package javax.annotation.processing does not exist" is now fixed, so I'm guessing you will want to close this. However, I am now hitting the same problem you found earlier, where one of the private member variables is not annotated with @Column
The reason for this is the following declaration:
public static final Creator<TblLocation> CREATOR = new Creator<TblLocation>()
{
@Override
public TblLocation createFromParcel (Parcel source) {return new TblLocation(source);}
@Override
public TblLocation[] newArray (int size) {return new TblLocation[size];}
};
which is part of the Parcelable management code. It is obviously not meant to be treated as a column.
What are your thoughts on this? And would you like me to open a new issue?
Many thanks, Adrian
Hi Adrian,
A new issue would be great.
Cheers, Sam
Hi,
Any idea why I might be getting this error at line:
"import javax.annotation.processing.Filer;"
in the com.memtrip.sqlking.preprocessor.processor.validation.context package?
I've recently had to reinstall AS 2.1, perhaps that has something to do with it?
Many thanks, Adrian