rive-app / rive-unity

MIT License
99 stars 11 forks source link

File.Load(asset) fails on Unity #64

Open BitBarrel opened 2 months ago

BitBarrel commented 2 months ago

This line works well in the Editor on windows: m_file = File.Load(asset);

But with an Android deployment, it returns zero.

I am also getting this error in the console: [Worker0] OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Any ideas?

damzobridge commented 2 months ago

For the file loading issue, can you confirm that you're using the OpenGL Graphics APIs and not Vulkan? I'm not able to reproduce this on my end on Android.

The OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM error is a known issue, and we're looking into it.

BitBarrel commented 2 months ago

Indeed it was caused by Vulkan being set by the automatic graphics API setting.

I have two recommendations to make related to this:

  1. In the example projects (basic and other Unity example projects), do not set the graphics API to automatic but instead to manual with no Vulkan selected.
  2. Detect if Vulkan is used and throw an understandable error instead of quietly not working on Android.