You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble with an FXGL project in IntelliJ IDEA. I'm receiving Cannot resolve errors even though I created a new Maven project and am using JDK 17.
Here are the details:
IDE: IntelliJ IDEA
Build System: Maven
JDK: 17
The errors I'm getting are:
Cannot resolve method 'onKeyPressed' in 'Input' (x8)
Cannot resolve symbol 'TransformComponent' (x1)
I have already tried the following troubleshooting steps:
Created a new project from the official FXGL Maven archetype.
Verified that my pom.xml file has the correct dependencies and repositories.
Cleared the IntelliJ caches and restarted the IDE.
Deleted the .idea folder and re-imported the project.
Confirmed that the Java code has all the necessary imports.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am having trouble with an FXGL project in IntelliJ IDEA. I'm receiving Cannot resolve errors even though I created a new Maven project and am using JDK 17.
Here are the details:
IDE: IntelliJ IDEA
Build System: Maven
JDK: 17
The errors I'm getting are:
Cannot resolve method 'onKeyPressed' in 'Input' (x8)
Cannot resolve symbol 'TransformComponent' (x1)
I have already tried the following troubleshooting steps:
Created a new project from the official FXGL Maven archetype.
Verified that my pom.xml file has the correct dependencies and repositories.
Cleared the IntelliJ caches and restarted the IDE.
Deleted the .idea folder and re-imported the project.
Confirmed that the Java code has all the necessary imports.
Here is my pom.xml:
XML
4.0.0
Java
package com.yourcompany;
import com.almasb.fxgl.app.GameApplication;
import com.almasb.fxgl.app.GameSettings;
import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.input.Input;
import com.almasb.fxgl.texture.AnimationChannel;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCode;
import javafx.util.Duration;
public class TheTruthWeaverApp extends GameApplication {
}
Here is my PlayerComponent.java:
Java
package com.yourcompany;
import com.almasb.fxgl.entity.component.Component;
import com.almasb.fxgl.entity.component.TransformComponent;
import com.almasb.fxgl.texture.AnimatedTexture;
import com.almasb.fxgl.texture.AnimationChannel;
import com.almasb.fxgl.core.math.FXGLMath;
import javafx.geometry.Point2D;
import com.almasb.fxgl.dsl.FXGL;
import javafx.util.Duration;
public class PlayerComponent extends Component {
}


Thank you for any help you can provide!
Beta Was this translation helpful? Give feedback.
All reactions