[Tex/LaTex] Bibliography processing issue with TeXstudio: “I couldn’t open file name `build/bibliographyCitation.aux'”

bibliographiesbibtextexstudio

I'm new using TeXstudio and I'm trying to cite the references in my work. But unfortunately I had an error says:

Process started: bibtex build/"bibliographyCitation"

I couldn't open file name `build/bibliographyCitation.aux'

Process exited normally

I searched about solutions for this problem but no one specify how can I know the default folder that has the .aux file? and how can I change it step by step?!

This is the current settings I have:
TeXstudio Settings

Thank you

Best Answer

The theory

In your settings, the bash command associated with BibTeX is: bibtex build/%. It means: "look for the (implicitely said .aux) file in following folder: <location of the .tex file you're compiling>/build".
This is handy when you tell (pdf)LaTeX to put every temporary/auxiliary files in a subfolder (here name build) in order to keep the original folder "clean". You activate this behavior using the -output-directory option while running (pdf)LaTeX (e.g., pdflatex -output-directory=build/ %.tex).

Your case

However, since you did not enabled this feature (i.e., the bash command used for (pdf)LaTeX compiling does not call the -output-directory option), all temp files are created in the same folder than the .tex file you are compiling.
But in your case, bibtex is still looking for the .aux-file in a non-existing subfolder named build: bibtex build/%.

The solution

Thus, you should tell bibtex to look for the .aux file in the same folder than your .tex file, i.e. write bibtex % instead of bibtex build/% at the BibTeX line.
(Or you could also create a subfolder named build, and use following commands: pdfLaTeX: pdflatex -output-directory=build/ %.tex; bibTeX: bibtex build/%. But you would also need to update paths for other commands (e.g. pdf-viewer).)