5

I am using Android Studio 3.5 in macos mojave

I had a project containing both java and ndk code in a folder, lets call it "project_folder_A"

I made a copy of this folder, renamed it to "project_folder_B" and continued to make modifications; project_folder_A is now deleted

Everything works as expected, however, if I try to clean the project, or change it from current "release" mode to "debug" mode to compile again, I get an error saying

ninja: fatal: chdir to '..!!folder_path!!.../project_folder_A/app/.cxx/cmake/debug/armeabi-v7a' - No such file or directory    

I cannot find a reference to project_folder_A anywhere inside the current project or in the gradle files. Why is android studio still remembering the old project folder? How do I remove all reference to the old folder name and force everything to compile using the current project folder?

--- EDIT:

Looking at the long error message more closely, the exact problem is this line

Error while executing process ..!!sdk path!!.../Android/sdk/cmake/3.10.2.4988404/bin/ninja with arguments {-C ..!!folder_path!!.../project_folder_A/app/.cxx/cmake/debug/armeabi-v7a clean}  

which causes an error because project_folder_A doesn't exist. All the other exception errors in the long build error message seem to have been caused by this error.

user13267
  • 6,871
  • 28
  • 80
  • 138

2 Answers2

9

You should delete the generated .cxx folder and the "build" folder. They both contain artifacts that contain irrelevant past data. attempt a clean build

Kowi
  • 211
  • 3
  • 6
2

@Kowi's answer was the only thing that worked for me when I was faced by the exact situation described above.

I deleted the .cxx folder inside the app directory of the project.(If it doesn't work maybe you can delete the build folder too as suggested by @Kowi, I didn't do that though)

The .cxx folder is a hidden folder though so unhide it with the CMD+SHIFT+DOT combination on a Mac and equivalent combos for other Operating Systems.

Once I deleted, I rebuilt the project and I was fine.

You should be fine too!

Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
gbenroscience
  • 994
  • 2
  • 10
  • 33