Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter invalid chars for gradle wrapper #1813

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

nitram84
Copy link
Contributor

@nitram84 nitram84 commented Apr 7, 2023

Some special chars in the app name can cause conflicts when you try to add a gradle wrapper. In this pull request I filter all invalid chars before generating settings.gradle

Here is an example app containing invalid chars: https://xn--who-becomes-rich--84ns4b8gwbu6jza3u.apk.gold/

Steps to reproduce:

  • save as gradle project
  • run 'gradle wrapper'
FAILURE: Build failed with an exception.

* Where:
Settings file 'settings.gradle' line: 2

* What went wrong:
A problem occurred evaluating settings.
> The project name 'Who Becomes Rich?' must not contain any of the following characters: [/, \, :, <, >, ", ?, *, |]. Set the 'rootProject.name' or adjust the 'include' statement (see https://docs.gradle.org/7.6/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[]) for more details).

This issue can also easily be reproduced with new Android Studio project. Android Studio does not allow any special chars in the application name when the app is generated, but AndroidManifest.xml can be edited later like in my unit test.

@skylot skylot merged commit 0421ad8 into skylot:master Apr 8, 2023
@skylot
Copy link
Owner

skylot commented Apr 8, 2023

@nitram84 thanks! Nice fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants