Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't my IDEA projects build?

I am building a software platform, and as a proof of concept (and to determine what it requires), I'm building an instant messenger called Telegram RP, using my platform repos listed here: https://github.com/BlueHuskyStudios/Blue-Husky-Software-Platform

Now, I've made the decision to separate the JVM-specific code from the generic code, but upon my first step doing so, it won't compile.

I'm stumped. I've triple-checked language-level visibilities, removed and re-added both Git and IDEA modules, triple-checked the dependency hierarchies, ensured parallel builds are off... and yet it still claims that there's an unresolved reference at build time, despite the editor letting me middle-/control-click to navigate to the import.

Can anyone help me understand how to make this understand that the package it's complaining about is actually there when I click build andor run?


I encourage you to clone these and attempt to build them in IDEA 2017.2:

Here's an SSCCE of my setup, which should compile just fine once all repos are cloned: https://github.com/BenLeggiero/SO-SSCCE-45271471

Here's the repo containing the project in question: https://github.com/BenLeggiero/Telegram-RP (permalink to repo when I asked this question)

Specifically, this sub-repo: https://github.com/BlueHuskyStudios/Husky-UI/tree/For-Telegram-RP

Here's the line that's failing: https://github.com/BlueHuskyStudios/Husky-UI/blob/6887f492c37583d82b49ebf36b12d68a3a1dcb32/JVM/src/org/bh/tools/ui/swing/Graphics%20Extensions.kt#L8

import org.bh.tools.ui.generic.geometry.FractionOval
                       ^ ~~~~~
Error:(8, 24) Kotlin: Unresolved reference: generic

This didn't happen before I moved Desktop-JVM-specific code from Husky UI/Core, to Husky UI/JVM, so I must assume it involves that... I just can't figure out why.


My environment:

IntelliJ IDEA 2017.2
Build #IC-172.3317.76, built on July 15, 2017
JRE: 1.8.0_152-release-915-b5 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

like image 796
Ky. Avatar asked Jul 24 '17 01:07

Ky.


2 Answers

It is all about module name changes after your refactoring, so the dependencies cannot be found.

1. In Telegram-RP/lib/Husky-UI/JVM/Husky UI JVM/JVM.iml changes

<orderEntry type="module" module-name="Husky UI/Core" exported="" />

to

<orderEntry type="module" module-name="Husky UI"  exported="" />

2. In Telegram-RP/Desktop JVM/Desktop JVM.iml

changes

<orderEntry type="module" module-name="Husky UI/Core" />
<orderEntry type="module" module-name="Husky UI/JVM" />

to

<orderEntry type="module" module-name="Husky UI" />
<orderEntry type="module" module-name="JVM" />

As a matter of fact, you can see module names from the Project view in bold text : enter image description here

like image 45
aristotll Avatar answered Nov 02 '22 04:11

aristotll


Got it figured after messing around a while. I'll post the git diff output so you can apply it directly to your files.

First, there's changes to be done in the submodule lib/Husky-UI/JVM/Husky UI JVM/JVM.iml (remember: you should edit the proper repository and update this project's git submodule):

-    <orderEntry type="module" module-name="Husky UI/Core" exported="" />
+    <orderEntry type="module" module-name="Husky UI" exported="" />

Then go after Core/Core.iml and remove those 2 lines:

-    <orderEntry type="module" module-name="Husky UI/Core" />
-    <orderEntry type="module" module-name="Husky UI/JVM" />

Finally,change Desktop JVM/Desktop JVM.iml:

+    <orderEntry type="module" module-name="Husky UI" exported="" />
+    <orderEntry type="module" module-name="Husky IO" exported="" />
+    <orderEntry type="module" module-name="JVM" exported="" />
     <orderEntry type="module" module-name="Blue Base" />
-    <orderEntry type="module" module-name="Husky IO" />
     <orderEntry type="module" module-name="Core" />
-    <orderEntry type="module" module-name="Husky UI/Core" />
-    <orderEntry type="module" module-name="Husky UI/JVM" />

Tell me how it worked out for you.

like image 113
cristianoms Avatar answered Nov 02 '22 04:11

cristianoms