Search Issue Tracker
Fixed in 2022.2.X
Fixed in 2022.1.X
Votes
1
Found in
2019.4
2019.4.34f1
2020.3
2021.2
2022.1
2022.2
Issue ID
1399538
Regression
No
UnityEngine.Application.identifier returns an empty string when called in UWP Build
How to reproduce:
1. Open the attached project "identifier.zip"
2. Open File>Build Settings...
3. Switch Platform to Universal Windows Platform
4. Build And Run the project
5. Open %USERPROFILE%\AppData\Local\Packages<productname>\TempState\UnityPlayer.log
Expected results: "package name: com.DefaultCompany.NewUnityProject7"
Actual results: "package name:"
Reproducible with: 2019.4.36f1, 2020.3.29f1, 2021.2.11f1, 2022.1.0b7, 2022.2.0a4
-
LucasSupportSquare
Jan 24, 2023 08:38
For anyone who wants to use the workaround, in my Unity version (2021.2.13f1) I had to change
return Windows.ApplicationModel.Package.Id.Name
to
return Windows.ApplicationModel.Package.Current.Id.Name;
in order to make it work.
Thanks for providing it! -
Tautvydas-Zilys
May 05, 2022 01:51
Hey @peachypixels,
we don't plan to backport this to 2020 & 2021 simply because it was never implemented on UWP and it was treated as a new feature. However, I added a workaround you can use in 2020.3 & 2021.3 in the resolution notes.
-
PeachyPixels
May 04, 2022 09:30
It would be great if this could be fixed in 2020 & 2021 as well. Thank you!
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2022.2):
Fixed in 2022.2.0a9
Workaround: you can retrieve application identifier on UWP by using this code:
static string GetApplicationIdentifierWithUWPWorkaround()
{
#if UNITY_WSA && ENABLE_WINMD_SUPPORT
return Windows.ApplicationModel.Package.Id.Name;
#else
return Application.identifier;
#endif
}
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0f1