Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading "Microsoft.Toolkit.Uwp.UI.Lottie 6.0.0", using "Windows App Cert Kit" general metadata correctness verification failed #214

Closed
KevinZjYang opened this issue Dec 24, 2019 · 52 comments · Fixed by microsoft/microsoft-ui-xaml#4218
Assignees

Comments

@KevinZjYang
Copy link

KevinZjYang commented Dec 24, 2019

Describe the bug

This problem occurs whenever I upgrade "Microsoft.Toolkit.Uwp.UI.Lottie" to version 6.0.0. Downgrading to version 5.1.1 is all right.
See the error for details:#2882,Just like what @dpaulino said.
Because that issue has been closed.

XAML:

 <Border Background="Transparent"
               Visibility="{x:Bind IsLoading, Mode=OneWay}">
         <winui:AnimatedVisualPlayer>
                 <lottie:LottieVisualSource UriSource="ms-appx:///AnimatedVisuals/wave-loading.json" />
         </winui:AnimatedVisualPlayer>
 </Border>
  • [ X] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
    Microsoft.Toolkit.Uwp.UI.Lottie 5.1.1 work.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Upgrade "Microsoft.Toolkit.Uwp.UI.Lottie" to version 6.0.0
  2. Create application package.
  3. Test with Windows App Cert Kit.
  4. See error

Expected behavior

 <TEST INDEX="58" NAME="一般元数据正确性" DESCRIPTION="元数据文件必须满足各种要求才是有效且正确的。" EXECUTIONTIME="00h:00m:09s.58ms" OPTIONAL="FALSE">
        <MESSAGES>
          <MESSAGE TEXT="文件 C:\Program Files\WindowsApps\8541KevinYang.28001B9000CE5_3.3.2.0_x64__z7y9f6aw0qfg2\Microsoft.Toolkit.Uwp.UI.Lottie.winmd 中类型为 Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass 的方法 add_AnimatedVisualInvalidated 的参数 value 引用了非 Windows 运行时类型 Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource。Windows 运行时类型仅可引用 Windows 运行时类型。" />
          <MESSAGE TEXT="未找到文件 C:\Program Files\WindowsApps\8541KevinYang.28001B9000CE5_3.3.2.0_x64__z7y9f6aw0qfg2\Microsoft.Toolkit.Uwp.UI.Lottie.winmd 中由类型 Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass 引用的类型 Microsoft.UI.Xaml.Controls.IAnimatedVisual。元数据文件中引用的所有类型都必须是可检测到的。" />
          <MESSAGE TEXT="文件 C:\Program Files\WindowsApps\8541KevinYang.28001B9000CE5_3.3.2.0_x64__z7y9f6aw0qfg2\Microsoft.Toolkit.Uwp.UI.Lottie.winmd 中类型为 Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource 的方法 add_AnimatedVisualInvalidated 的参数 value 引用了非 Windows 运行时类型 Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource。Windows 运行时类型仅可引用 Windows 运行时类型。" />
          <MESSAGE TEXT="未找到文件 C:\Program Files\WindowsApps\8541KevinYang.28001B9000CE5_3.3.2.0_x64__z7y9f6aw0qfg2\Microsoft.Toolkit.Uwp.UI.Lottie.winmd 中由类型 Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource 引用的类型 Microsoft.UI.Xaml.Controls.IAnimatedVisual。元数据文件中引用的所有类型都必须是可检测到的。" />
        </MESSAGES>
        <RESULT><![CDATA[FAIL]]></RESULT>
      </TEST>

Screenshots

批注 2019-12-24 133513

Environment

NuGet Package(s): 
Microsoft.UI.Xaml 2.3.191211002
Microsoft.Toolkit.Uwp.UI.Lottie 6.0.0

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x ] 2019 (version: ) 
- [ ] 2019 Preview (version: )

@ghost
Copy link

ghost commented Jan 8, 2020

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@KevinZjYang
Copy link
Author

Can anyone help me?

@michael-hawker michael-hawker transferred this issue from CommunityToolkit/WindowsCommunityToolkit Jan 15, 2020
@michael-hawker
Copy link
Member

FYI @simeoncran

@simeoncran simeoncran modified the milestone: 6.0 Jan 16, 2020
@KevinZjYang
Copy link
Author

KevinZjYang commented Feb 18, 2020

So long unsolved,I finally decided to deprecate "Microsoft.Toolkit.Uwp.UI.Lottie".
Use "Lottie Viewer" to convert json to c # code. Use as follows.

image

<winui:AnimatedVisualPlayer Width="200"  Height="160">
                    <animatedvisuals:WaveLoading />
</winui:AnimatedVisualPlayer>```

@simeoncran
Copy link
Contributor

@KevinZjYang sorry to see that this wasn't given attention back in January. Did you ever try submitting despite the WACK error? We've noticed that the WACK can give false positives that the store doesn't care about.

@jeremiethibeault
Copy link

I'm having the same issue on my last store submission:
Target: 10.0.18362.0
Microsoft.Toolkit.Uwp.UI: 6.0.0
Microsoft.Toolkit.Uwp.UI.Lottie: 6.0.0

Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.

@MatFillion
Copy link

@simeoncran the above post from @jeremiethibeault failed at the store submission, so it's not a false positive :/

Full code is available here https://github.com/unoplatform/uno.ch9

@simeoncran simeoncran reopened this Jun 18, 2020
@simeoncran
Copy link
Contributor

Thanks @MatFillion and @jeremiethibeault. We are looking into this and will report back here.

@simeoncran
Copy link
Contributor

@MatFillion and @jeremiethibeault. I'm told that there are known issues with how VS2017 packaged NuGet metadata that would explain what you're seeing.

Can you upgrade to the latest VS2019?

@jeremiethibeault
Copy link

Hey @simeoncran, I'm using VS2019 16.5.1. Not sure if the issue should still be applicable on this version. I can try on the latest version to see if it fixes the issue. Let me know if there is anything else I can try. I will also check the local WACK test result if I see the same error message, would be easier to debug that.

Thanks!

@simeoncran
Copy link
Contributor

16.6.2 is the latest version. When I loaded your solution VS required that it first upgrade the projects. I wonder if that's a hint.

@jeremiethibeault
Copy link

jeremiethibeault commented Jun 22, 2020

I was able to reproduce the issue locally on VS 16.6.2

I simply created the app bundles using the built-in publish feature of VS for UWP then I ran the WACK test locally which gave me the same result as on the store.

FAILED
General metadata correctness
Error Found: The general metadata correctness test detected the following errors:
Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file C:\Program Files\WindowsApps\nventive.Ch9_1.0.6.0_x64__jc868da5z7jr4\Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file C:\Program Files\WindowsApps\nventive.Ch9_1.0.6.0_x64__jc868da5z7jr4\Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.
Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file C:\Program Files\WindowsApps\nventive.Ch9_1.0.6.0_x64__jc868da5z7jr4\Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file C:\Program Files\WindowsApps\nventive.Ch9_1.0.6.0_x64__jc868da5z7jr4\Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.
Impact if not fixed: Microsoft store doesn't allow apps that don't pass Windows Runtime Metadata Validation.
How to fix: Please ensure that the compiler you are using to generate your Windows Runtime types is up to date with with the Windows Runtime specifications.

These are the specs

App Architecture:
x64
Kit Version:
10.0.19041.1
OS Version:
Microsoft Windows 10 Pro (10.0.19041.0)

@simeoncran
Copy link
Contributor

We have a local repro now. I still don't understand what is triggering it, but we're tracking down the experts and will keep this thread updated.

@simeoncran
Copy link
Contributor

simeoncran commented Jun 23, 2020

The issue is caused by the build not including Microsoft.UI.Xaml.winmd in the app package. You can check that by looking at the winmd files that get packaged into your .msix. As a result WACK doesn't find the references to IAnimatedVisualPlayer and IDynamicAnimatedVisualPlayer. We are looking into why that's happening.

EDIT: actually, the winmd is only missing from the sideload (MSIXBUNDLE) builds. The store builds (MSIXUPLOAD) have the MIcrosoft.UI.Xaml.winmd files. Usually you'd submit the MSIXUPLOAD files, but there are some circumstances where MSIXBUNDLE are needed in the store (has to do with corporate signing or something). @jeremiethibeault are you building MSIXBUNDLE (sideloading) or MSIXUPLOAD (store uploading) files?

@jeremiethibeault
Copy link

@simeoncran That's interesting, I'm building MSIXUPLOAD files through Visual Studio > Publish > Create app packages (the app is associated to the Microsoft Store)

The package I've submitted to the store is the MSIXUPLOAD one.

image

@jeremiethibeault
Copy link

I confirmed that the Microsoft.UI.Xaml.winmd file is inside .msixupload > .msixbundle > x64.msix > WinMetadata

@simeoncran
Copy link
Contributor

Thank you, that's very helpful. Will keep you informed.

@ajbennet
Copy link

ajbennet commented Jul 2, 2020

Hi @jeremiethibeault, this issue is taking longer than expected. I don't want you to be blocked till we figure this out, so I had asked for an exception to this rule for your app (Uno Ch9) and the exception is in place now. Please try submitting the package and let us know if you re able to do so. I ll keep you posted as we make progress in the actual issue. Thank you for your patience.

@jeremiethibeault
Copy link

Hey thanks @ajbennet, I submitted the app without the Lottie animation for now but I will take a look at resubmitting it with it.

Have a good day

@BenJKuhn
Copy link

We've been investigating this issue. The root cause appears to be an issue in the certification tests. There's a mismatch between how the tools bundle metadata in store submission packages and how the tests search for that data, specifically in the case where metadata is provided by framework packages. I'm glad @ajbennet was able to provide a workaround while we determine how to fix this issue.

@matthewacme
Copy link

matthewacme commented Jul 15, 2020

It's still happening BTW
@ajbennet So how does one go about getting added to that list of app's that are excepted from this rule?

@simeoncran
Copy link
Contributor

@matthewacme - can you give me some details and I'll see what I can do. No promises because I'm not really involved in the solution, but I can at least try to get your issue solved before this gets fixed for everyone.

@under3415
Copy link

Hi everyone,

Thank you for your patience as we investigated the issue. A solution is in the works for subsequent versions of WinUI (2.5 and later) but as a workaround you can do the following for now:

Open the .csproj or .vcxproj file that has a reference to the Lottie NuGet package and insert this target at the bottom of the file right before :

<Target Name="_AddXamlWinmdToPackageLayoutRoot" AfterTargets="_CreatePackageLayout">
    <Copy
        SourceFiles="@(_PackageLayoutFileSource)"
        DestinationFiles="@(_PackageLayoutFileSource->'$(AppxLayoutDir)%(Filename)%(Extension)')"
        Condition="'%(Filename)%(Extension)' == 'Microsoft.UI.Xaml.winmd'" />
</Target>

Thanks!

I can also confirm that using Microsft.UI.Xams version 2.5.0-prerelease.200812001 also fixed the issue.

@mentorfloat
Copy link

@nishitha-burman , I am using XAML Island with a WPF App. I've added the <Target> at the bottom of my UWP .csproj right before </Project> but still failed the Windows Runtime Metadata Validation in a local WACK test.

Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.
Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.

I cannot try the 2.5.0-prerelease suggested by @under3415 because it will create 17 other Build errors in my case. An example from the 17 errors:
Payload file '...\WPF Base\bin\x86\Release\netcoreapp3.1\win-x86\Microsoft.UI.Xaml\DensityStyles\Compact.xaml' does not exist. from Line 3036 in ...\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets

If I use the following NuGet packages, it will build but fail the metadata test as mentioned above:
Microsoft.UI.Xaml 2.4.3
Microsoft.Toolkit.Uwp.UI.Lottie 6.1.2
Microsoft.Toolkit.Win32.UI.XamlApplication 6.1.2
Microsoft.Toolkit.Wpf.UI.XamlHost 6.1.2

@nishitha-burman
Copy link
Collaborator

@mentorfloat apologies for the delayed reply, were you able to resolve the issue?

@mentorfloat
Copy link

No, I ended up removing Lottie entirely and instead created custom UserControl containing Key-Frame Animations.

@under3415
Copy link

The issue was resolved in Microsoft.UI.XAML 2.5.0-prerelease.201202003, but has re-appeared in stable release v2.5.0 :-(

@nishitha-burman
Copy link
Collaborator

Hi @under3415,

Does this issue appear in stable release v2.5.0 even with the workaround?

@under3415
Copy link

Hi @under3415,

Does this issue appear in stable release v2.5.0 even with the workaround?

Hi
Yes that is correct.

It was working fine in pre-release without a workaround.
Since updating to v.2.5.0 it is rejected from the store even with the workaround in place.

Regards
Dejan

@michael-hawker
Copy link
Member

@under3415 the WinUI pre-release and the release packages are built differently. FYT @ranjeshj

@under3415
Copy link

If things are done differently for production release, doesn't that defy the purpose of pre-release testing?
D

@nishitha-burman
Copy link
Collaborator

If you hit this issue while trying to publish your app please raise a support ticket on the store while we look into this issue. You can raise a ticket by doing the following:

  1. Open a web browser to http://aka.ms/storesupport
  2. Click "Contact Us"
  3. Select "Dashboard - Store apps and games, Hardware, Collaborative"

Thank you!

llongley added a commit to microsoft/microsoft-ui-xaml that referenced this issue Mar 15, 2021
WACK expects to be able to find WinMDs for type resolution purposes in the root of the AppX, but when WinUI 2 is referenced via framework package, the WinMD is instead placed in a WinMetadata subdirectory. As a result, applications that reference nuget packages with references to WinUI 2, WACK certification fails. I'm not sure whether placing the WinMD file in that directory is still needed, so to work around this issue in the safest manner, this adds an additional build target that places the WinMD where WACK certification needs it to be.

An example of an issue that will be resolved by this fix: CommunityToolkit/Lottie-Windows#214
@nishitha-burman
Copy link
Collaborator

Fix is checked into the WinUI 2 repo, should be fixed in 2.6.

@rajeshangappan
Copy link

After ugrading to latest version facing the below issue.
Exception thrown at 0x761EA8B2 :Microsoft C++ exception: winrt::hresult_error at memory location 0x09D3E9F8.

@nishitha-burman
Copy link
Collaborator

nishitha-burman commented Apr 12, 2021

Hi @rajeshangappan,

Thank you for reaching out. Which version of WinUI and Lottie are you using?

@under3415
Copy link

Hi
This is again an issue with the latest versions of UI XAML and Lottie:

  • Microsoft.UI.XAML 2.6.0-prerelease.210405001
  • Microsoft.Toolkit.Uwp.UI.Lottie v7.0.2
    Error Found: The general metadata correctness test detected the following errors:

    Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
    The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.ILottieVisualSourceClass in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.
    Parameter value of method add_AnimatedVisualInvalidated of type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd references the non-Windows Runtime type Microsoft.UI.Xaml.Controls.IDynamicAnimatedVisualSource. Windows Runtime types can reference only Windows Runtime types.
    The type Microsoft.UI.Xaml.Controls.IAnimatedVisual referenced by type Microsoft.Toolkit.Uwp.UI.Lottie.LottieVisualSource in file Microsoft.Toolkit.Uwp.UI.Lottie.winmd was not found. All types referenced in metadata files must be discoverable.


@nishitha-burman
Copy link
Collaborator

nishitha-burman commented Apr 13, 2021

Hi @under3415, are you getting the same exception mentioned here #214 (comment) when using the latest versions of WinUI and Lottie?

@under3415
Copy link

No, I am getting "metadata correctness test" error. I thought this bug is about that...

@nishitha-burman
Copy link
Collaborator

nishitha-burman commented Apr 13, 2021

Yes both #405 and this issue are about the metadata correctness test. I was curious if you were also getting the issue mentioned here: #214 (comment). Thanks for the clarification!

We are looking into the metadata correctness test failure.

@under3415
Copy link

I have also logged with with WinUI.

Do you understand what is going on here? The issue is fixed in one version, then regresses in the next!? It's happened twice already! It's really weird...

@eliezerpMS
Copy link
Contributor

@under3415. Sorry to hear that you are hitting this issue again. Looking at your post here it looks like WACK was failing when you updated to Microsoft.UI.XAML 2.6.0-prerelease.210315002. When this happened what version of Lottie were you on? If you keep Lottie on the last version that passed WACK(please let us know which one that is) are you able to identify which versions of Microsoft.UI.XAML 2.6.0-prerelease caused you to fail WACK?

Does the issue repro for you with the Lottie Sample app when using Microsoft.UI.XAML 2.6.0-prerelease.210405001 and Microsoft.Toolkit.Uwp.UI.Lottie v7.0.2. If not do you have a simple app you could share with us that repros this issue with these versions of Lottie and Microsoft.UI.XAML?

@under3415
Copy link

Lottie version does not seem to matter, the issue is fixed and broken in WinUI:

2.5.0-prerelease.201202003 OK
2.5.0 Broken
2.6.0-prerelease.210227001 OK
2.6.0-prerelease.210405001 Broken

I'm raising it here as well as in WinUI as I am not sure who needs to fix this, and why is it regressing.

@under3415
Copy link

This issue only happens when you try to submit to Microsoft Store on a "Non-flighted submission".
It passes certification using the certification app and even the test flight in the store.

So to replicate the issue, create an app using lottie and winui and submit to store as "Non-flighted submission".

@rajeshangappan
Copy link

Hi @rajeshangappan,

Thank you for reaching out. Which version of WinUI and Lottie are you using?

Lottie version:7.0.2, Microsoft.UI.Xaml:2.5.0

@nishitha-burman
Copy link
Collaborator

Fixed by Microsoft.UI.XAML: microsoft/microsoft-ui-xaml#3780

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.