Intermodalics / tango_ros

ROS related software for Tango
Apache License 2.0
67 stars 22 forks source link

App build fails with "error: cannot find symbol" #357

Closed furqan-habibi closed 6 years ago

furqan-habibi commented 7 years ago

I have done all the build steps as written, but end up with a build fail. I have built successfully in the past (~version 1.1). The error messages are as follows:

*
*
*
> Building 25% > :tango_ros_common:mergeReleaseResources:tango_ros_common:mergeReleaseResources
> Building 25%:tango_ros_common:processReleaseManifest
> Building 26% > :tango_ros_common:processReleaseResources:tango_ros_common:processReleaseResources
> Building 26%:tango_ros_common:generateReleaseSources
:tango_ros_common:incrementalReleaseJavaCompilationSafeguard
:tango_ros_common:javaPreCompileRelease
:tango_ros_common:compileReleaseJavaWithJavac
:tango_ros_common:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
> Building 27% > :tango_ros_common:compileReleaseJavaWithJavac/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:36: error: cannot find symbol
> Building 27% > :tango_ros_common:compileReleaseJavaWithJavacimport tango_ros_messages.LoadOccupancyGrid;
                         ^
  symbol:   class LoadOccupancyGrid
  location: package tango_ros_messages
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:37: error: cannot find symbol
import tango_ros_messages.LoadOccupancyGridRequest;
                         ^
  symbol:   class LoadOccupancyGridRequest
  location: package tango_ros_messages
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:38: error: cannot find symbol
import tango_ros_messages.LoadOccupancyGridResponse;
                         ^
  symbol:   class LoadOccupancyGridResponse
  location: package tango_ros_messages
> Building 27% > :tango_ros_common:compileReleaseJavaWithJavac/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:198: error: cannot find symbol
        saveMapRequest.setRequest((byte)(saveMapRequest.SAVE_LOCALIZATION_MAP | saveMapRequest.SAVE_OCCUPANCY_GRID));
                                                       ^
  symbol:   variable SAVE_LOCALIZATION_MAP
  location: variable saveMapRequest of type SaveMapRequest
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:198: error: cannot find symbol
        saveMapRequest.setRequest((byte)(saveMapRequest.SAVE_LOCALIZATION_MAP | saveMapRequest.SAVE_OCCUPANCY_GRID));
                                                                                              ^
  symbol:   variable SAVE_OCCUPANCY_GRID
  location: variable saveMapRequest of type SaveMapRequest
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:198: error: cannot find symbol
        saveMapRequest.setRequest((byte)(saveMapRequest.SAVE_LOCALIZATION_MAP | saveMapRequest.SAVE_OCCUPANCY_GRID));
                      ^
  symbol:   method setRequest(byte)
  location: variable saveMapRequest of type SaveMapRequest
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:204: error: cannot find symbol
                        saveMapResponse.getMessage(), saveMapResponse.getLocalizationMapName(),
                                                                     ^
  symbol:   method getLocalizationMapName()
  location: variable saveMapResponse of type SaveMapResponse
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:205: error: cannot find symbol
                        saveMapResponse.getLocalizationMapUuid());
                                       ^
  symbol:   method getLocalizationMapUuid()
  location: variable saveMapResponse of type SaveMapResponse
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:217: error: cannot find symbol
        ServiceClient<LoadOccupancyGridRequest, LoadOccupancyGridResponse> loadOccupancyGridService =
                      ^
  symbol:   class LoadOccupancyGridRequest
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:217: error: cannot find symbol
        ServiceClient<LoadOccupancyGridRequest, LoadOccupancyGridResponse> loadOccupancyGridService =
                                                ^
  symbol:   class LoadOccupancyGridResponse
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:220: error: cannot find symbol
                        LoadOccupancyGrid._TYPE);
                        ^
  symbol:   variable LoadOccupancyGrid
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:222: error: cannot find symbol
        LoadOccupancyGridRequest loadOccupancyGridRequest = mConnectedNode.getServiceRequestMessageFactory().newFromType(LoadOccupancyGrid._TYPE);
        ^
  symbol:   class LoadOccupancyGridRequest
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:222: error: cannot find symbol
        LoadOccupancyGridRequest loadOccupancyGridRequest = mConnectedNode.getServiceRequestMessageFactory().newFromType(LoadOccupancyGrid._TYPE);
                                                                                                                         ^
  symbol:   variable LoadOccupancyGrid
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:224: error: cannot find symbol
        loadOccupancyGridService.call(loadOccupancyGridRequest, new ServiceResponseListener<LoadOccupancyGridResponse>() {
                                                                                            ^
  symbol:   class LoadOccupancyGridResponse
  location: class TangoServiceClientNode
/home/kaigi/tango_ros_ws/src/tango_ros/tango_ros_common/tango_ros_common/src/main/java/eu/intermodalics/tango_ros_common/TangoServiceClientNode.java:226: error: cannot find symbol
            public void onSuccess(LoadOccupancyGridResponse loadOccupancyGridResponse) {
                                  ^
  symbol: class LoadOccupancyGridResponse
> Building 27% > :tango_ros_common:compileReleaseJavaWithJavac15 errors
:tango_ros_common:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tango_ros_common:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 46.431 secs
CMakeFiles/gradle-tango_ros_streamer.dir/build.make:57: recipe for target 'CMakeFiles/gradle-tango_ros_streamer' failed
make[2]: *** [CMakeFiles/gradle-tango_ros_streamer] Error 1
CMakeFiles/Makefile2:291: recipe for target 'CMakeFiles/gradle-tango_ros_streamer.dir/all' failed
make[1]: *** [CMakeFiles/gradle-tango_ros_streamer.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

It looks like some newer class (LoadOccupancyGrid etc.) in tango_ros_messages is not detected by the compiler. I am not quite sure but there might be a connection with the fact that tango_ros_messages maven repository is still serving the old (1.0.0) version. https://github.com/rosjava/rosjava_mvn_repo/tree/master/org/ros/rosjava_messages/tango_ros_messages

furqan-habibi commented 7 years ago

I finally managed to make it build successfully. The steps are as follows:

FAILURE: Build failed with an exception.

Though I can build the app successfully, this seems like a very hacky way to do it. If someone from the development team can help investigate this I'd be really thankful. However I know you guys are busy in the development cycle right now so keep up the hard work and I love what you guys are doing.

Cheers.

PerrineAguiar commented 7 years ago

@furqan-habibi Thanks for the kind words.

I think your issue was indeed related to the new classes of the tango_ros_messages package. I guess what really solved the problem was deleting the tango_ros_messages.jar and rebuilding.

Today we released the new version of the tango_ros_messages package. So the app now depends on org.ros.rosjava_messages:tango_ros_messages:2.0.0 (instead of 1.0.0). As a consequence, if you pull the latest changes from master, you might get some issues again with this dependency while building. The solution we found for this problem is as follow:

I hope this helps.