Another caching (?) problem, "invalid dependency detected"

hi,

I'm having more "caching" problems with sbt-idea support. For example:


Error:(129, 36) missing or invalid dependency detected while loading class file 'NodeGraph.class'.
Could not access term topology in package de.sciss,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'NodeGraph.class' was compiled against an incompatible version of de.sciss.
            val top = NodeGraph(s).topology
                                   ^


This was after I refactored `NodeGraph` to use a different `topology` type. Now closing and re-opening the project, freshing sbt, calling Build > Rebuilt Project all have zero effect. I'm again stuck with a damaged project that I cannot build unless I delete the whole idea project files and create a new project. Note that `NodeGraph` is part of that same project I'm trying to build. I can even edit that class so theoretically I must be recompiled by the incremental build. I seems that the dependency analysis is thus broken.

0
Avatar
Permanently deleted user

The origin of this problem seems to be related with IDEA not picking up new dependencies in the build.sbt. For example if I add the annotation:

    val top: Topology[_, _] = NodeGraph(s).topology

Then `Topology` is red without IDEA suggesting its import, although I have added that type through a libraryDependency.

0
Avatar
Permanently deleted user

Ok, I think this is an sbt problem. Because I ran `sbt test:compile` from the terminal, and it had the same error.
I then ran `sbt -Ylog-classpath test:compile` as suggested, and that succeeded without any errors or warnings. And afterwards the problem was "gone". :-E

0

请先登录再写评论。