JonHarder / RoboCodeCompetition

3 stars 4 forks source link

Gradle build failing #1

Closed kirsten-ruge closed 5 years ago

kirsten-ruge commented 5 years ago

I got the following errors when trying to run "gradle build" from the terminal inside my IntelliJ:

Kirstens-MacBook-Pro:RoboCodeCompetition kirstenruge$ gradle build Starting a Gradle Daemon (subsequent builds will be faster)

Task :compileJava FAILED /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/WaveBullet.java:3: error: package robocode.util does not exist import robocode.util.Utils; ^ /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:4: error: package robocode.util does not exist import robocode.util.Utils; ^ /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:16: error: cannot find symbol public class StarterBot extends AdvancedRobot { ^ symbol: class AdvancedRobot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:76: error: cannot find symbol public void onScannedRobot(ScannedRobotEvent e) { ^ symbol: class ScannedRobotEvent location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:215: error: cannot find symbol public void onHitByBullet(HitByBulletEvent e) { ^ symbol: class HitByBulletEvent location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:319: error: cannot find symbol public void onHitWall(HitWallEvent e) { ^ symbol: class HitWallEvent location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:356: error: cannot find symbol private static void setBackAsFront(AdvancedRobot robot, double goAngle) { ^ symbol: class AdvancedRobot location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:3: error: package robocode does not exist import robocode.; ^ /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/WaveBullet.java:41: error: cannot find symbol double angleOffset = Utils.normalRelativeAngle(desiredDirection - startBearing); ^ symbol: variable Utils location: class WaveBullet /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:58: error: cannot find symbol this.setAdjustGunForRobotTurn(true); ^ symbol: method setAdjustGunForRobotTurn(boolean) /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:59: error: cannot find symbol this.setAdjustRadarForGunTurn(true); ^ symbol: method setAdjustRadarForGunTurn(boolean) /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:62: error: cannot find symbol this.turnRadarRightRadians(Double.POSITIVE_INFINITY); ^ symbol: method turnRadarRightRadians(double) /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:77: error: cannot find symbol this._myLocation = new Point2D.Double(this.getX(), this.getY()); ^ symbol: method getX() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:77: error: cannot find symbol this._myLocation = new Point2D.Double(this.getX(), this.getY()); ^ symbol: method getY() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:80: error: cannot find symbol double lateralVelocity = this.getVelocity() Math.sin(e.getBearingRadians()); ^ symbol: method getVelocity() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:81: error: cannot find symbol double absBearing = e.getBearingRadians() + this.getHeadingRadians(); ^ symbol: method getHeadingRadians() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:83: error: cannot find symbol this.setTurnRadarRightRadians(Utils.normalRelativeAngle(absBearing - getRadarHeadingRadians()) 2); ^ symbol: method getRadarHeadingRadians() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:83: error: cannot find symbol this.setTurnRadarRightRadians(Utils.normalRelativeAngle(absBearing - getRadarHeadingRadians()) 2); ^ symbol: variable Utils location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:91: error: cannot find symbol ew.fireTime = getTime() - 1; ^ symbol: method getTime() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:113: error: cannot find symbol double ex = getX() + Math.sin(absBearing) e.getDistance(); ^ symbol: method getX() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:114: error: cannot find symbol double ey = getY() + Math.cos(absBearing) e.getDistance(); ^ symbol: method getY() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:119: error: cannot find symbol if(currentWave.checkHit(ex, ey, getTime())) { ^ symbol: method getTime() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:136: error: cannot find symbol WaveBullet newWave = new WaveBullet(getX(), getY(), absBearing, power, direction, getTime(), currentStats); ^ symbol: method getX() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:136: error: cannot find symbol WaveBullet newWave = new WaveBullet(getX(), getY(), absBearing, power, direction, getTime(), currentStats); ^ symbol: method getY() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:136: error: cannot find symbol WaveBullet newWave = new WaveBullet(getX(), getY(), absBearing, power, direction, getTime(), currentStats); ^ symbol: method getTime() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:147: error: cannot find symbol absBearing - getGunHeadingRadians() + angleOffset); ^ symbol: method getGunHeadingRadians() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:146: error: cannot find symbol double gunAdjust = Utils.normalRelativeAngle( ^ symbol: variable Utils location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:148: error: cannot find symbol setTurnGunRightRadians(gunAdjust); ^ symbol: method setTurnGunRightRadians(double) location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:149: error: cannot find symbol if(getGunHeat() == 0 && gunAdjust < Math.atan2(9, e.getDistance()) && setFireBullet(power) != null) { ^ symbol: method getGunHeat() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:149: error: cannot find symbol if(getGunHeat() == 0 && gunAdjust < Math.atan2(9, e.getDistance()) && setFireBullet(power) != null) { ^ symbol: method setFireBullet(double) location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:159: error: cannot find symbol ew.distanceTraveled = (getTime() - ew.fireTime) ew.bulletVelocity; ^ symbol: method getTime() location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:191: error: cannot find symbol double factor = Utils.normalRelativeAngle(offsetAngle) / maxEscapeAngle(ew.bulletVelocity) ew.direction; ^ symbol: variable Utils location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:245: error: cannot find symbol double predictedVelocity = this.getVelocity(); ^ symbol: method getVelocity() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:246: error: cannot find symbol double predictedHeading = this.getHeadingRadians(); ^ symbol: method getHeadingRadians() /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:263: error: cannot find symbol moveAngle = Utils.normalRelativeAngle(moveAngle); ^ symbol: variable Utils location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:267: error: cannot find symbol predictedHeading = Utils.normalRelativeAngle(predictedHeading + limit(maxTurning, moveAngle, maxTurning)); ^ symbol: variable Utils location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:321: error: cannot find symbol back(20); ^ symbol: method back(int) location: class StarterBot /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java:357: error: cannot find symbol double angle = Utils.normalRelativeAngle(goAngle - robot.getHeadingRadians()); ^ symbol: variable Utils location: class StarterBot Note: /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/kirstenruge/Documents/GitHub/RoboCodeCompetition/src/starterbot/StarterBot.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 38 errors

FAILURE: Build failed with an exception.

BUILD FAILED in 7s 1 actionable task: 1 executed Kirstens-MacBook-Pro:RoboCodeCompetition kirstenruge$

Here is my project setup: screen shot 2019-03-07 at 10 41 43 am

johnvandeweghe commented 5 years ago

There is a step that is buried in the instructions that has you update a path in your gradle file. Judging from the error you have maybe you missed the step, or got the wrong path to robocode.jar?

kirsten-ruge commented 5 years ago

yep, that fixed it, thanks!