telerik / UI-For-UWP

This repo contains the source code for Telerik UI for Universal Windows Platform (UWP), which includes 20+ UI controls for developers building UWP applications.
http://www.telerik.com/uwp/
Other
1.16k stars 234 forks source link

Unable to install multi-platform bundle that includes Telerik.UI.for.UniversalWindowsPlatform #441

Closed Zofware closed 4 years ago

Zofware commented 4 years ago

Description

Any app that includes Telerik.UI.for.UniversalWindowsPlatform cannot be installed successfully if built as a multi-platform bundle. For example, if I start with the default blank UWP app in Visual Studio 2019, add Telerik.UI.for.UniversalWindowsPlatform to it, then build a bundle for x64 and ARM64 the install fails with the following error:

App installation failed with error message: Merge failure for shared merged PRI file : error 0x80070490 : Cannot register the ffed6aa4-df6d-476c-b790-31d891bae046_1.0.0.0_x64__hz258y3tkez3a package because there was a merge failure with the following file: C:\Program Files\WindowsApps\ffed6aa4-df6d-476c-b790-31d891bae046_1.0.0.0_neutral_split.scale-180_hz258y3tkez3a\resources.pri (0x80070490)

Steps to Reproduce

  1. Use Visual Studio 2019 to create a "Blank App (Universal Windows)".
  2. Set the target platform version to "Windows 10, version 1903 (10.0; Build 18362)" and the minium version to "Windows 10; version 1809 (10.0; Build 17763)".
  3. Use NuGet to add Telerik.UI.for.UniversalWindowsPlatform" to the project.
  4. Create an app package for sideloading choosing "Generate app bundle: Always" and targeting "Release (x64)" and "Release (ARM64)".
  5. Attempt to install the resulting msixbundle. It will fail with a "Merge failure for shared merged PRI file".

Expected Behavior

App should install normally.

Actual Behavior

App install fails with an error: App installation failed with error message: Merge failure for shared merged PRI file : error 0x80070490 : Cannot register the ffed6aa4-df6d-476c-b790-31d891bae046_1.0.0.0_x64__hz258y3tkez3a package because there was a merge failure with the following file: C:\Program Files\WindowsApps\ffed6aa4-df6d-476c-b790-31d891bae046_1.0.0.0_neutral_split.scale-180_hz258y3tkez3a\resources.pri (0x80070490)

Basic Information

Screenshots

Image1 Image2 Image3 Image4b Image5 Image6 Image7 Image8 Image9 Image10

Reproduction Link

Visual Studio project: App1.zip

Zofware commented 4 years ago

There does appear to be a workaround but I'm not sure it's a good idea because it disables splitting resource packages for different scale resources. Even with the workaround there's clearly a bug still lurking here but I don't know if it's in how the UI-For-UWP package is laid out or if it's a bug in the way Visual Studio builds packages containing a variety of resource scales.

FWIW, the workaround is to add the following to the first PropertyGroup in the .csproj project file:

<AppxBundleAutoResourcePackageQualifiers>Language|DXFeatureLevel</AppxBundleAutoResourcePackageQualifiers>

I got the idea for this workaround from this page: https://docs.microsoft.com/en-us/windows/uwp/app-resources/build-resources-into-app-package

APopatanasov commented 4 years ago

Hi @Zofware ,

Almost every control that is part of the nuget package is build in AnyCPU configuration. The only exception is the Map control that is separately built for x86, x64 and ARM - there isn't an ARM64 configuration.

One of the reasons for the observed by you issue might be the fact that the Map control doesn't have an ARM64 build binaries. Unfortunately, currently we don't have an ARM64 device to test that theory. Attached you can find a nuget package that doesn't include the Map inside it. Could you please, test your solution using the provided nuget and let me know if the issues still occurs.

Thanks in advance.

I am looking forward to hearing from you. Telerik.UI.for.UniversalWindowsPlatform.1.0.1.8.zip

Zofware commented 4 years ago

Yes! That was it. My test app when built with the map-less nuget package you provided installs successfully. I don't use the map control so this map-less version of your nuget package seems like a viable solution to my problem. Would you consider publishing a map-less version of your package to nuget going forward (or add an ARM64 configuration to your current package)?

I'm in the same boat as you as far as not having an ARM64 device to test with. I live just a few minutes from a Microsoft Store which has several Surface Pro X devices on hand. The employees there have been willing to let me run tests on their devices in the past (as long as it's something I can install from the online Store). My plan is to build an ARM64 test app and publish it to the online Store then drive over to the physical Store to test it. If you want to build and publish a ARM64 test app for any of your stuff I'm happy to test it at the physical Microsoft Store and give you a report.

APopatanasov commented 4 years ago

@Zofware thanks for the confirmation that the nuget works without the Map control. I have added the ARM64 build architecture for the Map and build a new package that includes it.

When you have an opportunity can you please test it and let me know if it works.

Thanks again for your help. Telerik.UI.for.UniversalWindowsPlatform.1.0.1.8.zip

Zofware commented 4 years ago

@APopatanasov unfortunately no luck with this one. When I build for x64 and ARM64 and try to install on x64 I get the following error:

App installation failed with error message: Merge failure for shared merged PRI file : error 0x80070490 : Cannot register the ffed6aa4-df6d-476c-b790-31d891bae046_1.0.6.0_x64__hz258y3tkez3a package because there was a merge failure with the following file: C:\Program Files\WindowsApps\ffed6aa4-df6d-476c-b790-31d891bae046_1.0.6.0_neutral_split.scale-180_hz258y3tkez3a\resources.pri (0x80070490)

When I build for x64 and ARM (not ARM64) then it installs on x64 successfully. Very strange. There's definitely something fishy with the ARM64 configuration. I have to wonder if it's something with the assets/resources rather than the binary because the error message mentions the resources file.

APopatanasov commented 4 years ago

@Zofware I think I was able to fix the ARM64 configuration - I have missed to enable the native toolchain when building for Release ARM64. I am no longer able to observe any issues when building a package for x64 and ARM64 - I have tested on machines with x64 architecture.

Attached you can find a nuget package that contains the latest changes. Could you please, test you application again? Telerik.UI.for.UniversalWindowsPlatform.1.0.1.9.zip

Zofware commented 4 years ago

I think you can declare victory. Your 1.0.1.9 build worked for me when building for x64+ARM64 and installing on x64. Thank you!

APopatanasov commented 4 years ago

@Zofware Thanks for your confirmation that now everything works as expected.

I will make a pull request with the changes that add the ARM64 configuration for the Map control. Once the request is merged the fix will be available with the next official nuget release scheduled for May.

In the meantime you can use the package provided in my latest response.

Thank you again for your collaboration.

Zofware commented 4 years ago

Thanks Atanas!

Zofware commented 4 years ago

@APopatanasov here is the Telerik DataGrid running in an ARM64 UWP app on a Surface Pro X using the 1.9 build you linked above. I didn't test the map control though, but at least I can confirm the data grid works on ARM64. Thanks again.

image