Im having a case where graph GraphA is in MainModu...
# compose-destinations
r
Im having a case where graph GraphA is in MainModule and GraphB is in SecondaryModule Composable is in MainModule annotating ComposableA() with @Destination<GraphA> works great but adding a second destination @Destination<GraphB> results in compilation error, any clue whats wrong or if this is achievable?
Copy code
e: [ksp] java.lang.NullPointerException
	at com.ramcosta.composedestinations.codegen.commons.RawNavGraphTreeBuilderKt.makeNavGraphTrees(RawNavGraphTreeBuilder.kt:73)
	at com.ramcosta.composedestinations.codegen.writers.ModuleOutputWriter.write(ModuleOutputWriter.kt:28)
	at com.ramcosta.composedestinations.codegen.CodeGenerator.postValidateGenerate(CodeGenerator.kt:66)
	at com.ramcosta.composedestinations.codegen.CodeGenerator.generate(CodeGenerator.kt:49)
	at com.ramcosta.composedestinations.ksp.processors.Processor.process(Processor.kt:85)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:306)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:304)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:410)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:304)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112)
	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:77)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:256)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:247)
	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:247)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:87)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:50)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1523)
	at jdk.internal.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
r
@Destination<GraphB> is in the same module as GraphB annotation?
r
Yes
r
Can you copy paste the actual code? It’s a little difficult to understand exactly your setup.
I’m assuming there’s something wrong in your setup. In any case, the error should at least be more helpful. Once we identify the issue, I’ll improve the error message 🙂
🙌 1
Also what version are you using?
r
I will try to send some snippets, can't copy paste actual code though :( will do that later as I'm out now
As far as I remember I was using latest beta
ok i think ive made some mistake so both of these graphs are in different modules but im connecting both of these in Main module sorry for misguiding but im getting lost in all of these, just refactored almost whole app to use you'r navigation from navcomponent which works great so far 🙌
Copy code
version 2.0.0-beta09


@Destination<MainModuleSubGraph>()
@Destination<ModuleBSubgraph1>() <- adding this causes compilation error
@Composable
fun MainModuleScreenComposable(){...}

@NavGraph<MainGraph>()
annotation class MainModuleSubGraph

@NavGraph<ExternalModuleGraph>()
annotation class ModuleBGraph

@NavGraph<ModuleBGraph>()
annotation class ModuleBSubgraph1

@NavHostGraph()
annotation class MainGraph {
    @ExternalNavGraph<ModuleBGraph>(start = true)
    companion object Includes
}
r
Yeah so ModuleBSubgraph1 is an annotation defined in another module (named moduleB) right? You cannot add destinations to graphs from other modules.
You can “include” a destination or graph from another module but not the other way around
r
I see, thank you, is it possible to add a better error description though?
r
Yes definitely! Already on my todo list 🙂
🙌 1