android错误(RealmClass注释不支持嵌套类)

非淡泊无以明志,非宁静无以致远。这篇文章主要讲述android错误:RealmClass注释不支持嵌套类相关的知识,希望能为你提供帮助。
我尝试在项目中包含Realm db但遇到了问题。
我有嵌套类:

@RealmClass public class Shops implements RealmModel {RealmList< Shop> data; Meta meta; public Shops() { }public RealmList< Shop> getShops() { return data; }public Pagination getPagination() { if (meta == null) return null; if (meta.pagination == null) return null; return meta.pagination; }private static class Meta extends RealmObject { Pagination pagination; }public static class Pagination extends RealmObject { Links links; // ... }public static class Links extends RealmObject { String next; public String previous; //... } }

我试着改变代码。但没有任何帮助。什么问题,请告诉我?
它解决了!
但接下来。
在Realm出现问题后,我在编译时遇到了dagger 2的新问题
Error:(10, 33) error: cannot find symbol class DaggerAppComponent Error:java.lang.RuntimeException: java.lang.NullPointerException Error:java.lang.NullPointerException

清理和重建项目,也删除.gradle和重建没有帮助我。
项目代码没有太大变化,只添加了Realm db。
有什么问题,请告诉我?
【android错误(RealmClass注释不支持嵌套类)】日志:
20:58:12.515 [ERROR] [system.err] import xxx.xxx.xxx.dagger.DaggerAppComponent; 20:58:12.515 [ERROR] [system.err]^ 20:58:12.515 [ERROR] [system.err]symbol:class DaggerAppComponent 20:58:12.515 [ERROR] [system.err]location: package xxx.xxx.xxx.dagger 20:58:12.633 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 20:58:12.633 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 20:58:12.634 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 20:58:12.634 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 20:58:12.634 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:compileDebugJavaWithJavac'. 20:58:12.634 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.NullPointerException 20:58:12.635 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 20:58:12.636 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is: 20:58:12.636 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. 20:58:12.636 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84) 20:58:12.637 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55) 20:58:12.637 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) 20:58:12.637 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 20:58:12.637 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) 20:58:12.637 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46) 20:58:12.638 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) 20:58:12.638 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) 20:58:12.639 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 20:58:12.639 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 20:58:12.639 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236) 20:58:12.639 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228) 20:58:12.640 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.Transformers$4.transform(Transformers.java:169) 20:58:12.640 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) 20:58:12.640 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) 20:58:12.641 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228) 20:58:12.641 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215) 20:58:12.641 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77) 20:58:12.641 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58) 20:58:12.642 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32) 20:58:12.642 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113) 20:58:12.642 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 20:58:12.642 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 20:58:12.643 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) 20:58:12.643 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) 20:58:12.643 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 20:58:12.643 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 20:58:12.644 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 20:58:12.644 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196) 20:58:12.645 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193) 20:58:12.645 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.Transformers$4.transform(Transformers.java:169) 20:58:12.646 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) 20:58:12.646 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) 20:58:12.647 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193) 20:58:12.647 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119) 20:58:12.647 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102) 20:58:12.647 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71) 20:58:12.649 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50) 20:58:12.649 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 20:58:12.649 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43) 20:58:12.650 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40) 20:58:12.650 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.Transformers$4.transform(Transformers.java:169) 20:58:12.650 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) 20:58:12.650 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) 20:58:12.651 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40) 20:58:12.651 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75) 20:58:12.651 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) 20:58:12.652 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) 20:58:12.652 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) 20:58:12.652 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) 20:58:12.652 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) 20:58:12.653 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44) 20:58:12.653 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29) 20:58:12.653 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) 20:58:12.653 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 20:58:12.654 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.654 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47) 20:58:12.654 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.655 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) 20:58:12.655 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.655 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) 20:58:12.656 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.656 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) 20:58:12.656 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) 20:58:12.657 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.util.Swapper.swap(Swapper.java:38) 20:58:12.657 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) 20:58:12.658 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.658 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) 20:58:12.659 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.659 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) 20:58:12.659 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 20:58:12.660 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.660 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) 20:58:12.661 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 20:58:12.661 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) 20:58:12.662 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) 20:58:12.662 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) 20:58:12.662 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) 20:58:12.663 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) 20:58:12.663 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.RuntimeException: java.lang.NullPointerException 20:58:12.663 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.main.Main.compile(Main.java:553) 20:58:12.664 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) 20:58:12.664 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) 20:58:12.664 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:46) 20:58:12.664 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33) 20:58:12.664 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104) 20:58:12.665 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53) 20:58:12.665 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38) 20:58:12.665 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35) 20:58:12.665 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25) 20:58:12.666 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:206) 20:58:12.666 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:187) 20:58:12.666 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:130) 20:58:12.666 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49) 20:58:12.667 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) 20:58:12.667 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163) 20:58:12.667 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134) 20:58:12.667 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123) 20:58:12.668 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95) 20:58:12.668 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76) 20:58:12.668 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]... 78 more 20:58:12.668 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.NullPointerException 20:58:12.669 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at io.realm.processor.Utils.initialize(Utils.java:37) 20:58:12.669 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at io.realm.processor.RealmProcessor.process(RealmProcessor.java:158) 20:58:12.669 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) 20:58:12.670 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) 20:58:12.670 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) 20:58:12.670 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) 20:58:12.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) 20:58:12.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) 20:58:12.671 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) 20:58:12.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]at com.sun.tools.javac.main.Main.compile(Main.java:523) 20:58:12.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]... 97 more 20:58:12.672 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]

答案将其添加到gradle中。
compile 'io.realm:realm-annotations-processor:4.0.0'


    推荐阅读