Since that one was closed and I cannot reopen/reply I started a new one.
I am building for Android and am running into the following crash on app start: Unable to find method CallIdentityTokenChanged in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.AnalyticsSessionInfo
I have tried the suggestions mentioned in the linked thread, however they do not fix the issue. We are using Unity 2022.3.38f1, building for target API 34.
We are not using UnityAnalytics, it is not visible under services nor is it present in the manifest.json
Below is our UnityCloudSettings.asset file, as you can see analytics is disabled.
After I run build it gets enabled.
I’ve tried using OnPreprocessBuild to make sure it is disabled, however something is enabling it.
Sorry to resurrect this thread, but we are now facing the same issue in Unity 6000.0.28f1 when building for iOS.
We have tried applying the force disabling of Unity Analytics inside the UnityConnectSettings.asset file but it still shows the errors in builds.
Unable to find type [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.AnalyticsSessionInfo
Unable to find method CallIdentityTokenChanged in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.AnalyticsSessionInfo
Unable to find method CallSessionStateChanged in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.AnalyticsSessionInfo
Unable to find type [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.AnalyticsSessionState
Unable to find type [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.Analytics.ContinuousEvent
Unable to find method RemoteConfigSettingsUpdated in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.RemoteConfigSettings
Unable to find type [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.RemoteConfigSettingsHelper/Tag
Unable to find method RemoteSettingsBeforeFetchFromServer in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.RemoteSettings
Unable to find method RemoteSettingsUpdateCompleted in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.RemoteSettings
Unable to find method RemoteSettingsUpdated in [UnityEngine.UnityAnalyticsModule.dll]UnityEngine.RemoteSettings
Any suggestions would be grateful on resolving this.
Thanks you saved me. If anyone needs, I just made a quick copy and paste using @Adam_Poncle code
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Experimental;
using UnityEngine;
public class AnalyticsRemover : IPreprocessBuildWithReport
{
public int callbackOrder { get; }
public void OnPreprocessBuild(BuildReport report)
{
var connectSettingsRes = EditorResources.Load<Object>("ProjectSettings/UnityConnectSettings.asset");
var connectSettingsObj = new SerializedObject(connectSettingsRes);
connectSettingsObj.FindProperty("m_Enabled").boolValue = false;
connectSettingsObj.FindProperty("UnityAnalyticsSettings" ).FindPropertyRelative( "m_Enabled" ).boolValue = false;
connectSettingsObj.ApplyModifiedProperties();
AssetDatabase.SaveAssets();
Debug.Log("Analytics disabled");
}
}