Skip to content

Commit f37e653

Browse files
authored
[Android][build] Fix android package name containing - (#93077)
* [Android][build] Fix Android package naming * Remove unnecessary code
1 parent c441891 commit f37e653

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tasks/AndroidAppBuilder/ApkBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ public ApkBuilder(TaskLoggingHelper logger)
338338
string monodroidSource = (IsLibraryMode) ? "monodroid-librarymode.c" : "monodroid.c";
339339

340340
string cmakeLists = Utils.GetEmbeddedResource("CMakeLists-android.txt")
341-
.Replace("%ProjectName%", ProjectName)
342341
.Replace("%MonoInclude%", monoRuntimeHeaders)
343342
.Replace("%NativeLibrariesToLink%", nativeLibraries)
344343
.Replace("%MONODROID_SOURCE%", monodroidSource)
@@ -393,6 +392,9 @@ public ApkBuilder(TaskLoggingHelper logger)
393392
if (!string.IsNullOrEmpty(ProjectName) && checkNumerics.IsMatch(ProjectName))
394393
ProjectName = checkNumerics.Replace(ProjectName, @"_$1");
395394

395+
if (!string.IsNullOrEmpty(ProjectName) && ProjectName.Contains('-'))
396+
ProjectName = ProjectName.Replace("-", "_");
397+
396398
string packageId = $"net.dot.{ProjectName}";
397399

398400
File.WriteAllText(javaActivityPath,

0 commit comments

Comments
 (0)