Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Help for error: Resource and asset merger: 'P' is not a valid file-based resource name character

Discussion in 'Android' started by melgeorgiou, Sep 25, 2023.

  1. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    762
    This seems like a really weird issue, but I've been trying to upgrade an older game to Unity 2021.3 and I've been getting this error relating to the PNG app icons automatically created by Unity:

    Code (CSharp):
    1.  
    2. FAILURE: Build failed with an exception.
    3.  
    4. * What went wrong:
    5. Execution failed for task ':unityLibrary:packageReleaseResources'.
    6. > /Users/melgeorgiou/Desktop/postbrutal2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/res/drawable-ldpi-v11/PostBrutal.png: Error: 'P' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
    7.   /Users/melgeorgiou/Desktop/postbrutal2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/res/drawable-xhdpi-v11/PostBrutal.png: Error: 'P' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
    8.   /Users/melgeorgiou/Desktop/postbrutal2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/res/drawable-xxhdpi-v11/PostBrutal.png: Error: 'P' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
    9.   /Users/melgeorgiou/Desktop/postbrutal2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/res/drawable-hdpi-v11/PostBrutal.png: Error: 'P' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
    10.   /Users/melgeorgiou/Desktop/postbrutal2021/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/res/drawable-mdpi-v11/PostBrutal.png: Error: 'P' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore
    11.  
    12. * Try:
    13. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    14.  
    15. * Get more help at https://help.gradle.org
    16.  
    17. BUILD FAILED in 12s
    18.  
    19. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
    20.  

    Is this some kind of strange bug? The PNG found in the drawable folders also have capital letters in the name which I'm guessing appears to be the source of the issue - for some reason Unity isn't making it lowercase.

    The actual file image files used for the icons are named postbrutal2023, pb_front and pb_back.

    BTW: For good measure, I've stripped out all plugins and I'm still having this issue. I've already tried setting the override package name to make sure it was all lowercase, as well as changing the product name to lowercase without spacing ("postbrutal"). The only place where I can see the title written as "Post Brutal" and not "postbrutal", is the actual project name for the game setup in Unity Services - so that is the only place I can think of where it may be using that name. Has anyone else experienced this or have an idea to fix?

    Thanks!
     
  2. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    762
    Update:

    So this looks like it was some kind of unity corruption (possibly because this project was originally created in Unity 4 and was incrementally upgraded to 2021.3). I could not fix this without creating an entirely new project, and then moving all the files in manually, and setting up the project settings from scratch.

    Crazy pain, but at least this error is now gone. No idea what was causing it but this nuclear solution worked for others that might stumble upon this.