• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android Studio res file error "The file name must end with .xml" when trying to run mediapipe exampl


Feb 17, 2022
Hello! I am a AI software developer but I am very new to android development and its overall architecture and IDE(Android Studio).

I am trying to create an android version of my AI app. I am trying to estimate and track pose of hands in real-time on camera. There is a example solution on a GitHub Repo from Google with their Media Pipe Machine Learning Library/API tool kit right here: https://github.com/google/mediapipe/tree/master/mediapipe/examples/android/solutions

This should be an easily runnable solution with instructions here: https://google.github.io/mediapipe/getting_started/android_solutions.html
I follow this instructions including running create_win_symlinks.bat since I am on a windows machine.

I am running into what seems to be a very silly and novice issue when I am trying to build this solution but I have had no luck trying to solve it or finding an answer.

The error message is: the file name must end with .xml and it is referring to my res file

So replicating my steps:
I import this project into my Android Studio. I then run create_win_symlinks.bat as administrator to create the res directory symlinks.

Then finally, I sync project with Grade Files. That ends up being succesful and I finally try to run the hands solution on the Pixel 2 emulator but I get an project error saying

the file name must end with .xml

This is pointing to my res inside the hands solution folder. It gives me the same error when I try to run face mesh and face detection to their respective res folder.

I checked the res file and it is a unspecified file(in file explorer) that seems to just point to the res in the project directory that includes all the .xml files for the UI

I am using the latest version of Android Studio and I upgraded the gradle plugin as it was recommending me to and that did not solve the problem either. I posted screenshots of the error message and my file contents and project directory.

Any pointers as to what I need to do to fix this problem?



In the screenshot you posted, I see a file named "res" under the "BUILD" file. The error seems to be telling you that the "res" file should be renamed to "res.xml".
That is what I initially tried, renaming it but the file contains invalid XML.
The res file contains ```../../../res``` which is pointing to the res folder under the solutions root. That contains a directory of xml files.
Upvote 0
For anyone who is having this problem on windows, the issue is that when you run the create_win_symlinks.bat the first step is to use a command that windows might not recognize to remove the placeholder files which are these res files that contain ```../../../res```.

Solution that worked for me was to manually delete them in the hands, facedetection, and facemesh /src/main folders then running the create_win_symlinks.bat again.
Upvote 0


We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.