Loading Lottie library causes the app to crash when it is installed from the Microsoft Store

Abierto
#526 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp

Línea de trabajo

Comienza con el AppxManifest generado y el destino .wapproj que elimina entradas de _AppxWinmdFilesToHarvest. Compara el paquete instalado localmente con el paquete instalado desde Microsoft Store, centrándote en la activación de LottieVisualSource y en las entradas duplicadas del servidor en proceso. Se considera completado cuando el paquete de Store se instala y muestra la animación de Lottie sin excepciones de manifest ni de activación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

I'm building a WPF application and using Lottie in an Xaml Islands custom component.

When packaging the desktop bridge project, I receive an App manifest validation error with the following content:

Validation error. error 80080204: App manifest validation error: Line 315, Column 27, Reason: The field "*[local-name()='Extensions']/*[local-name()='Extension']/*[local-name()='InProcessServer']/*[local-name()='ActivatableClass']" with value "Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource" must only be declared once. A duplicate exists on Line 64, Column 27.

The mentioned lines and the corresponding tag in the AppxManifest has the following content:

<Extension Category="windows.activatableClass.inProcessServer">
  <InProcessServer>
    <Path>UILibrary.dll</Path>
*64*    <ActivatableClass ActivatableClassId="Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource" ThreadingModel="both" />
    <ActivatableClass ActivatableClassId="Microsoft.UI.Xaml.Markup.ReflectionXamlMetadataProvider" ThreadingModel="both" />
  </InProcessServer>
</Extension>
...
<Extension Category="windows.activatableClass.inProcessServer">
  <InProcessServer>
    <Path>CLRHost.dll</Path>
*315*    <ActivatableClass ActivatableClassId="Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource" ThreadingModel="both" />
  </InProcessServer>
</Extension>

From this workaround, I added the following lines to the .wapproj file:

<Target Name="_RemoveWinMDFromAppxManifest" BeforeTargets="_GenerateCurrentProjectAppxManifest">
    <ItemGroup>
      <_AppxWinmdFilesToHarvest Remove="@(_AppxWinmdFilesToHarvest)" />
    </ItemGroup>
  </Target>

With this, I could achieve to not to duplicate these dependencies in the AppxManifest.xaml when creating the build, so the issue has gone and I could create the package for the Store submission.

I could upload to the store, it is published, but when I install it from the store, the app crashes when it should display a lottie animation with the following exception:

* When the Lottie is initalized from Xaml:
(0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Microsoft.Toolkit.Uwp.UI.Controls.WrapPanel.MeasureOverride(Size availableSize)

* Exception, when it is initialized from the code behind:
Cannot create instance of type 'Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource' [Line: 0 Position: 0]

The interesting part is that the animation is played when I install the exact same build from the local package. So, seemingly the Store modifies the package during the publish procedure, but what can I do other way?

I'm using Lottie version 7.1.1

Lenguaje dominante
C#
Estrellas
723
Forks
79
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CommunityToolkit/Lottie-Windows

Todos los issues de CommunityToolkit/Lottie-Windows

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.