Skip to content

Commit

Permalink
Fix Unity 2022 debugger crash. (#722)
Browse files Browse the repository at this point in the history
Fix a crash by enabling development mode in debug exports.
  • Loading branch information
timbotimbo authored Jan 12, 2023
1 parent d68f880 commit a3314ee
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
playerOptions.locationPathName = APKPath;
if (!isReleaseBuild)
{
playerOptions.options = BuildOptions.AllowDebugging;
// remove this line if you don't use a debugger and you want to speed up the flutter build
playerOptions.options = BuildOptions.AllowDebugging | BuildOptions.Development;
}
#if UNITY_2022_1_OR_NEWER
PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.Android, isReleaseBuild ? Il2CppCompilerConfiguration.Release : Il2CppCompilerConfiguration.Debug);
Expand Down Expand Up @@ -334,9 +335,6 @@ private static void ModifyAndroidGradle(bool isPlugin)
{
buildText = Regex.Replace(buildText, @"implementation\(name: 'androidx.* ext:'aar'\)", "\n");
}
// build_text = Regex.Replace(build_text, @"commandLineArgs.add\(\"--enable-debugger\"\)", "\n");
// build_text = Regex.Replace(build_text, @"commandLineArgs.add\(\"--profiler-report\"\)", "\n");
// build_text = Regex.Replace(build_text, @"commandLineArgs.add\(\"--profiler-output-file=\" + workingDir + \"/build/il2cpp_\"+ abi + \"_\" + configuration + \"/il2cpp_conv.traceevents\"\)", "\n");

buildText = Regex.Replace(buildText, @"\n.*applicationId '.+'.*\n", "\n");
File.WriteAllText(buildFile, buildText);
Expand Down Expand Up @@ -388,7 +386,7 @@ private static void BuildIOS(String path, bool isReleaseBuild)

if (!isReleaseBuild)
{
playerOptions.options = BuildOptions.AllowDebugging;
playerOptions.options = BuildOptions.AllowDebugging | BuildOptions.Development;
}

// build addressable
Expand Down

0 comments on commit a3314ee

Please sign in to comment.