You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I'm using Firebase for push notifications on my unity project, and after adding the Didomi SDK the Android build started crashing, after some investigation we figured out it was because of the lack of android:theme="@style/UnityThemeSelector" in the manifest.
The manifest file was automatically generated by firebase and the activity tag looks like this: <activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
The fix was to manually change it to be: <activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@style/UnityThemeSelector">
The post-processor in the Didomi package has this method:
private static void UpdateThemeAppCompatInAndroidManifestFile(string path)
{
var unityAndroidmManifestFile = $@"src{PostProcessorSettings.FilePathSeperator}main{PostProcessorSettings.FilePathSeperator}AndroidManifest.xml";
var unityAndroidmManifestFileAbsolutePath = Path.Combine(path, unityAndroidmManifestFile);
var lines = File.ReadAllLines(unityAndroidmManifestFileAbsolutePath);
var builder = new StringBuilder();
var oldValue = @"android:theme=""@style/UnityThemeSelector""";
var newValue = @"android:theme=""@style/DidomiTheme""";
foreach (var line in lines)
{
if (line.Contains(oldValue))
{
builder.AppendLine(line.Replace(oldValue, newValue));
}
else
{
builder.AppendLine(line);
}
}
File.WriteAllText(unityAndroidmManifestFileAbsolutePath, builder.ToString());
}
But in cases like mine, where the entry for "@style/UnityThemeSelector" is not there, it simply won't do anything
The text was updated successfully, but these errors were encountered:
Hello @gsteinkirch-bytro, thanks for your feedback and thanks for providing the workaround. We will try to find a long-term solution for this issue in a future release.
Hey! I'm using Firebase for push notifications on my unity project, and after adding the Didomi SDK the Android build started crashing, after some investigation we figured out it was because of the lack of
android:theme="@style/UnityThemeSelector"
in the manifest.The manifest file was automatically generated by firebase and the activity tag looks like this:
<activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
The fix was to manually change it to be:
<activity android:name="com.google.firebase.MessagingUnityPlayerActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@style/UnityThemeSelector">
The post-processor in the Didomi package has this method:
But in cases like mine, where the entry for "@style/UnityThemeSelector" is not there, it simply won't do anything
The text was updated successfully, but these errors were encountered: