Errors flagged in source with 2016.1, but build and run works

Answered

I have a project that worked fine with Idea 15, but with 2016.1 I am getting spurious error flags in one source file. Screenshot below, and if I hover over the error it says "cannot access com.controlj.utility.CJLog". This class is in a JAR file that is a included in the build.gradle for a module called Utilities, which my app module depends on. If I include the same JAR file in the app build.gradle the error goes away but then I get the problem with multiple definitions when DEXing. Even though these errors are flagged, the module builds and runs just fine, both from Idea and the command line using gradlew.

6 comments

Another screenshot showing the error message:

0

Please try the patch from https://youtrack.jetbrains.com/issue/IDEA-150685#comment=27-1361291.

Also try File | Invalidate Caches | Invalidate and Restart and refresh the Gradle project.

If it doesn't help, please file a bug at https://youtrack.jetbrains.com/issues/IDEA and attach a sample project to reproduce this problem.

0

Invalidating caches was no help.

Installing the new jars gives this:

Plugin Error
Problems found loading plugins:
Plugin "Android Support" was not loaded: required plugin "Gradle" not installed.
Plugin "RoboVM Intellij IDEA Plugin" was not loaded: required plugin "Gradle" not installed.


I'll create a sample project if I have time, but will go back to 15 for now.

0

It looks like an android specific issue. And hence the patch from IDEA-150685 will not help. The project import differs very much in android-gradle projects, e.g. there is no custom source sets support and many things works differently compared to regular gradle projects.

That's why it would be great if you could share the sample to reproduce the issue.

0

Revisiting this problem, which still exists in 2016.2. I have created a sample project that demonstrates the problem. The module Test2/app builds correctly, but the IDE shows errors.

The sample project is zipped here: https://www.dropbox.com/s/1ksz8yuo3u1r8dc/test.zip?dl=0

0

Please sign in to leave a comment.