SU_ERROR_SERIALIZATION when calling SUModelCreateFromFile through 2021 sdk

My program needs to read data from a skp file. The program works well on skp files of version 2016~2020.

Now I am trying to upgrade to 2021 sdk. I have replaced all the .cpp/.h/.lib/.dll files. Then I did some simple tests:

  1. If I try to open a skp file of version 2020, everything is ok.
  2. Open the same skp file in step 1 with su 2021, then save it. Now it is a skp file of version 2021.
    Then SUModelCreateFromFile returns SU_ERROR_SERIALIZATION. An exception “atlast::mfc::CArchiveException” is found in the log at this time.
  3. I ran the sample under “samples\ReadingFromAskpFile”. Everything is ok with the skp file of version 2021.

Can’t find more information from the document. How to do further truble shooting?

Can you provide example SketchUp files? One in SU2020 format, and a copy after you saved it in SU2021?

I’m not sure I fully understood that one. Are you saying the ReadingFromAskpFile reads SU2021 files correctly? But your own code doesn’t do so? (If so, can you provide a minimal reproduction example of when it fails?)

Are you saying the ReadingFromAskpFile reads SU2021 files correctly?

Yes. You are right.

If so, can you provide a minimal reproduction example of when it fails?

It is not so straight forward, because I am using the SU SDK in Unreal Engine 4.
I guess that the SDK uses CArchive, which is a MFC API, to read skp file of version 2021, but does not use that when reading previous version. And unfortunately Unreal Engine 4 is not compatible with MFC.

It’s actually the other way around.

The SketchUp file format used to be based on MFCs CArchive, yes. As of SU2021 that changed, .skp files written with SU2021 or newer does not use MFC logic.

So I’m not sure what is going on. Did you eventually figure out a solution?