AssetDatabase.LoadAssetAtPath is null? Any way to load Sprite asset?

AssetDatabase.GetMainAssetTypeAtPath for the same path is Texture2d.

I remember that I used same code a few years ago but now AssetDatabase.LoadAssetAtPath returns null. Is something changed with this api?

How to load Texture2d as a Sprite? Surprisingly I was unable to google something useful on this issue…

You load a Texture2D as a Sprite, this is not possible. You can change the import settings to Sprite and load it as a Sprite. Or you have to create the Sprite at runtime, use Create function.