Problem with building in P3.3.6, android mode 4, possible Gradle issue?

Hi,

I ran the live wallpaper tutorial on the android mode 4.0 successfully but the next time I tried to build it the emulator returned an error in the resources merging part of the build, the part where it failed is pasted below:


:app:mergeDebugResources C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-mdpi\icon-48.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xhdpi\icon-96.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxhdpi\icon-144.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxxhdpi\icon-192.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'. > C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-mdpi\icon-48.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xhdpi\icon-96.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxhdpi\icon-144.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxxhdpi\icon-192.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore

I should add that I am not using or adding my own icons, just trying to standard build using the default template icons supplied by processing. It appears that Gradle will not allow icon names with a hyphen (e.g. icon-48.png).

Does anyone have any ideas that might help? Thanks if possible,

poly

Answers

  • @poly===

    icons names (like other android res) can only use a to z chars (lower case) an numbers from 1 to 9 + underscore: that has nothing to see with gradle, it s an android rule: if the icon is named icon-48.png that fires a fatal error.

  • Yes, I understand that. However the icon list that Processing recommends at different dpi specifically states that it must replace the default template icons (originals are in the mode folder), for example, icon-36.png, icon-48.png and so on. I am guessing that the building steps which processing uses to package the sketch as an android wallpaper somehow get around this.

    I resolved the problem by deleting all of the extra folders in the sketch folder and rebuilding. This time it built without error and then incorporated the files (including the icons) into the package. When I looked inside the APK the icons had been renamed (presumably by Processing during the build) to remove the hyphen and number.

Sign In or Register to comment.