Skip to content

Commit

Permalink
Added Edditor option for Issue [#2930] kotlinx_coroutines_core.versio…
Browse files Browse the repository at this point in the history
…n collision.

PiperOrigin-RevId: 577025460
  • Loading branch information
Nicholas Ventimiglia authored and maddevrelgithubbot committed Nov 13, 2023
1 parent 9952e02 commit af5f3f8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Expand Up @@ -41,6 +41,9 @@ internal static GoogleMobileAdsSettings LoadInstance()
[SerializeField]
private bool delayAppMeasurementInit;

[SerializeField]
private bool enableKotlinXCoroutinesPackagingOption = true;

[SerializeField]
private bool optimizeInitialization;

Expand All @@ -57,6 +60,12 @@ public string GoogleMobileAdsAndroidAppId
set { adMobAndroidAppId = value; }
}

public bool EnableKotlinXCoroutinesPackagingOption
{
get { return enableKotlinXCoroutinesPackagingOption; }
set { enableKotlinXCoroutinesPackagingOption = value; }
}

public string GoogleMobileAdsIOSAppId
{
get { return adMobIOSAppId; }
Expand Down
Expand Up @@ -11,6 +11,7 @@ public class GoogleMobileAdsSettingsEditor : UnityEditor.Editor
SerializedProperty _appIdAndroid;
SerializedProperty _appIdiOS;
SerializedProperty _delayAppMeasurement;
SerializedProperty _enableKotlinXCoroutinesPackagingOption;
SerializedProperty _optimizeInitialization;
SerializedProperty _optimizeAdLoading;
SerializedProperty _userTrackingUsageDescription;
Expand All @@ -27,6 +28,8 @@ public void OnEnable()
_appIdAndroid = serializedObject.FindProperty("adMobAndroidAppId");
_appIdiOS = serializedObject.FindProperty("adMobIOSAppId");
_delayAppMeasurement = serializedObject.FindProperty("delayAppMeasurementInit");
_enableKotlinXCoroutinesPackagingOption =
serializedObject.FindProperty("enableKotlinXCoroutinesPackagingOption");
_optimizeInitialization = serializedObject.FindProperty("optimizeInitialization");
_optimizeAdLoading = serializedObject.FindProperty("optimizeAdLoading");
_userTrackingUsageDescription =
Expand Down Expand Up @@ -60,11 +63,23 @@ public override void OnInspectorGUI()
EditorGUI.indentLevel--;
EditorGUILayout.Separator();

EditorGUILayout.LabelField("Android optimization settings", EditorStyles.boldLabel);
EditorGUILayout.LabelField("Android settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++;

EditorGUI.BeginChangeCheck();

EditorGUILayout.PropertyField(_enableKotlinXCoroutinesPackagingOption,
new GUIContent("Enable kotlinx.coroutines packaging option."));

if (settings.EnableKotlinXCoroutinesPackagingOption)
{
EditorGUILayout.HelpBox(
"Adds instruction to fix a build.gradle build error with message"+
" '2 files found with path 'META-INF/kotlinx_coroutines_core.version'."+
" For more details see https://developers.google.com/admob/unity/gradle",
MessageType.Info);
}

EditorGUILayout.PropertyField(_optimizeInitialization,
new GUIContent("Optimize initialization"));
if (settings.OptimizeInitialization) {
Expand Down

0 comments on commit af5f3f8

Please sign in to comment.