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

Microsoft.Xna.Framework.Content.ContentLoadException when loading fonts(Spritefont) - other content types seem to be fine #7174

Closed
DeanLaw14 opened this issue May 30, 2020 · 22 comments

Comments

@DeanLaw14
Copy link

Full exception Details:
Microsoft.Xna.Framework.Content.ContentLoadException:
Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ListReader 1[[System.Char, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] (Microsoft.Xna.Framework.Content.ListReader 1[[System.Char, System.Private.CoreLib]])

Platform details****Versions: 3.8.0.1375-develop
OS: Windows
MonoGame platform: Both Android and iOS

@harry-cpp
Copy link
Member

Can you provide a sample project?

@DeanLaw14
Copy link
Author

@harry-cpp
Copy link
Member

Looking into it, found 2 bugs in your project setup:

I did however find an unrelated bug regarding font building from Mac.

@DeanLaw14
Copy link
Author

image

I'm still experiencing the same issue - even after applying the changes you pointed out :(

Note: Im assuming you saw my commented out line in the Game1 class line 32 :O
Otherwise my bad if you missed that - in the mean time im going to try and get someone else to run that sample just to see if its specific to my machine (I highly doubt)

@harry-cpp
Copy link
Member

Oh, this might have something to do with compiling from Windows.

@harry-cpp harry-cpp reopened this Jun 3, 2020
@harry-cpp
Copy link
Member

(Also didn't mean to close this before, pressed the wrong button)

@DeanLaw14
Copy link
Author

Ahh cool no probs. PS - Im sure it gets said enough but you and the rest of the devs have done an awesome job!

@YTN0
Copy link
Contributor

YTN0 commented Jun 11, 2020

I am running into the same issue with the latest 3.8 dev nugets. Is there a solution for this?

@harry-cpp
Copy link
Member

Are you also compiling iOS game from Windows?

@YTN0
Copy link
Contributor

YTN0 commented Jun 11, 2020

@harry-cpp No, I am compiling on Windows (DirectX).

@harry-cpp
Copy link
Member

Can you give me a repro project?

@YTN0
Copy link
Contributor

YTN0 commented Jun 12, 2020

@harry-cpp will try and put something together to illustrate the problem...

@YTN0
Copy link
Contributor

YTN0 commented Jun 13, 2020

@harry-cpp I created a brand new project on windows and added a spritefont. Note, I deleted the packages folder since it was making the zip file too big (>700MB). Visual Studio will re-download the packages. If you need to manually add the nuget packages, just add the Monogame DirectX, Content Pipeline and content builder task nugets (I was using build 3.8.0.1403).

The specific error it throws when trying to run is:

Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ListReader1[[System.Char, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] (Microsoft.Xna.Framework.Content.ListReader1[[System.Char, System.Private.CoreLib]])

Compiling the spritefont doesn't have any issues.

FontTest.zip

@harry-cpp
Copy link
Member

Okey, I think I see what the problem is!

harry-cpp added a commit to harry-cpp/MonoGame that referenced this issue Jun 13, 2020
@YTN0
Copy link
Contributor

YTN0 commented Jun 13, 2020

@harry-cpp I tried your build with the fixes (build 1405) and I now get the following error:

D:/Dev/csharp/game/Test/fonts/arial.xml : error : Processor 'FontDescriptionProcessor' had unexpected failure!
1> System.DllNotFoundException: Unable to load DLL 'freetype6' or one of its dependencies: The specified module could not be found. (0x8007007E)
1> at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)

Do I need both changes from 1405 and 1406 for this to work correctly?

@harry-cpp
Copy link
Member

Do I need both changes from 1405 and 1406 for this to work correctly?

I've only submitted a PR: #7199, build 1405 is the one that run for it.

D:/Dev/csharp/game/Test/fonts/arial.xml : error : Processor 'FontDescriptionProcessor' had unexpected failure!
1> System.DllNotFoundException: Unable to load DLL 'freetype6' or one of its dependencies: The specified module could not be found. (0x8007007E)
1> at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)

Thats a content build failure, it has nothing to do with all of this, you are missing "vs c++ 2012 redist" stuff, tho I personally just quickly grabbed a newer freetype6 as even with "vs c++ 2012 redist" I couldn't get it to work.

@YTN0
Copy link
Contributor

YTN0 commented Jun 13, 2020

@harry-cpp I have the runtimes installed and don't have an issue compiling fonts on projects which use the standard monogame installer or when I was running build 1403. The only issue I had then was the font loading issue when trying to run.

This problem only started occurring when trying build 1405 with the changes you submitted.

I'll try re-installing my VC runtimes, but I don't think that's the issue.

@harry-cpp
Copy link
Member

My changes do not touch content compilation. I know what I'm talking about.

@YTN0
Copy link
Contributor

YTN0 commented Jun 13, 2020

Seems like something got messed up on my laptop. I can't get past the freetype6 issue now. I have installed the VC runtimes (2012, 2013, 2015-2019) multiple times and it still doesn't fix it.

I may have to re-install VS to see if that solves it.

@harry-cpp
Copy link
Member

You can just grab a newer version of the lib from: https://github.com/Robmaister/SharpFont.Dependencies/blob/f8b032e132b7319099c916b78ec131866997f643/freetype2/2.6/msvc12/x64/freetype6.dll and replace the one found in packages/.nuget/.dotnet folders, and it will work.

@YTN0
Copy link
Contributor

YTN0 commented Jun 13, 2020

@harry-cpp I replaced the dll in all the * .monogame. * packages within the project (that have the dll) and that fixes that problem.

Also, build 1405 with your fix resolves the font loading issue at runtime. Thanks for fixing this!

@Jjagg Jjagg closed this as completed in e435491 Jun 14, 2020
@MauriceButler
Copy link
Contributor

MauriceButler commented Jul 4, 2020

Is there anywhere I can grab the MonoGame.Framework.Android build 1405 or greater?

I cant find it in the artefacts on the Team City server but facing the same issue.

I am assuming the android builds happen somewhere else?

Edit: Seems Android and iOS are currently skipped in the CI build.
Any chance of kicking off a full build?
If not I'll build from source for now I guess.

[16:57:17][Step 2/2] BuildAndroid                  Skipped             
[16:57:17][Step 2/2] BuildiOS                      Skipped             

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

No branches or pull requests

4 participants