1. Are you ready for the Galaxy S20? Here is everything we know so far!

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

Discussion in 'Android Development' started by ozth89, Feb 17, 2022.

  1. ozth89

    ozth89 Lurker
    Thread Starter

    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?



    1. Download the Forums for Android™ app!


  2. GameTheory

    GameTheory Android Expert

    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".
    James_Watson likes this.
  3. ozth89

    ozth89 Lurker
    Thread Starter

    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.
  4. Axcmaw

    Axcmaw Lurker

    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.

Share This Page