Catkin_ws error: catkin_ws/src/package.xml does not exist

When trying to run catkin_make, I get the following errors:

CMake Error: File /home/user/catkin_ws/src/package.xml does not exist.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/stamp.cmake:10 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:72 (stamp)
/opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:50 (_catkin_package_xml)
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:99 (catkin_package_xml)
CMakeLists.txt:103 (catkin_package)

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:116 (message):
catkin_package() ‘catkin’ must be listed as a buildtool dependency in the
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
CMakeLists.txt:103 (catkin_package)

It seems to be looking for the file catkin_ws/src/package.xml, which I don’t think is supposed to exist. I’ve tried running catkin_make clean, but this is unable to run for the same reason. I also manually deleted catkin_make.cache and CMakeCache.txt before attempting a make, and this did not help.

Prior to this error occurring, I accidentally created a package directly under catkin_ws, then attempted to move it by running “mv package_name/* src/” , but then I decided to just remove all of those files from the src/ directory and run the command again. I think the error is caused by some remnant from this process somewhere. Any way I can clean this up?

Edit: I’ve tried exiting the workspace for more than 20 minutes (overnight), as it has been stated in other threads that this causes a new virtual computer assignment, which did not work. I ended up trying to download the build and devel folders from the workspace of another lesson path and replacing the existing folders in the ROS Basics in 5 Days learning path. However, the files seem to actually be broken across all of the learning paths and replacing them did not work.

One thing I thought might be significant-- in the catkin_ws/build/catkin_generated/stamps directory, the generated subdirectory is always called “actions_quiz” rather than “Project” after attempting catkin_make.

I found a solution:

I created a backup of my packages, and just deleted the entire catkin_ws directory and rebuilt it. From the ~/user directory:

rm -r catkin_ws
mkdir -p catkin_ws/src
cd catkin_ws

The first compile takes awhile, but the problem is fixed finally.

1 Like