Closed Basewq closed 5 months ago
A target API of 34 is required in .NET 8.0, although it wouldn't explain why Space Escape sometimes works for you with API 33.
@Ethereal77 mentions here that they found issues in the Silk.net integration, maybe they can provide some insights on the OpenGL exception in your log.
https://github.com/stride3d/stride/issues/2008#issuecomment-2118745380
A target API of 34 is required in .NET 8.0, although it wouldn't explain why Space Escape sometimes works for you with API 33.
To clarify, the doc here (though it says it's for MAUI, the android csproj settings are relevant to xamarin). The Stride projects specify the following:
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
(ie. this is the min api target)Target API & minimum API are different things. There shouldn't be any issues specifically with the emulator's api (otherwise Android would reject installing them if they don't meet the min api level). I have SDK for api 34 installed, and have uploaded non-Stride Android Xamarin on the Google Play Store - believe me, they auto-detect & reject your app if your target api isn't correct, so I know the Stride apps will be building with target api 34.
Yes, it's probably a Silk integration issue, though don't really have time to investigate further at the moment. Hopefully this be might enough to hint for anyone else wanting to look into it (eg. searching 'OpenGL FramebufferIncompleteAttachment' comes up with 100 different issues and solutions, lol)
@Ethereal77 mentions here that they found issues in the Silk.net integration, maybe they can provide some insights on the OpenGL exception in your log.
To clarify, in that comment I'm talking about DirectX. The problems I've encountered were in the use of the API in certain scenarios. Nothing specific to Silk.NET and not related to OpenGL or Vulkan, which is what Android would use.
Quick minor update based on what I've found, which I'll need to expand on in the future when I have time.
Graphics API 'OpenGL ES 2' and less is not supported on an engine level so probably needs to be documented for Stride developers using Android. There used to be code for emulating 'Uniform Buffers' on OpenGL ES 2, but was cut out, so the engine failed to generate any buffers of this nature (this is the shader cbuffer
stuff, so deeply embedded into the engine). Not exactly sure what's the relationship between this and Framebuffer texture error, it could just be a snowball effect, since the engine actually does some 'uniform buffer' setup before this particular error (also this is an engine thrown exception after checking the GL api state, whereas the 'uniform buffer' ones are not checked).
The Android 10/Api 29 emulator did not support ES 3 on my machine, so at some point failed (though not immediately), since some of the GL calls are not constantly checking if the GL calls failed or not. Even though I've set up the Stride Game Settings to be OpenGL ES 3, if the hardware doesn't support it, then Stride will drop your settings to ES 2 - but as stated before ES 2 is not supported. Developers are most likely going to need to check the hardware's ES version and prevent the app from continuing if not done on an engine level.
After making a debug build of the Stride code, the Android 13/Api 33 tested on New game worked after a while, it took a long time because it was building the shaders - will need to recheck what's the deal with the official release version, there might be some multithreaded GL api call running over each other, or it just might be slow as well. Didn't retest TopDownRPG yet.
Issue has been properly identified by #2283 with a workaround.
Release Type: Official Release
Version: 4.2.0.2122
Platform(s): Android
Describe the bug SpaceEscape, TopDownRPG & 'New game' templates crash when deploying Debug build to Android emulator with the following error:
Android Emulator used: Android 10/Api 29, x86_64
Note that when using Android 13/Api 33, x86_64, only a black screen appears for New game & TopDownRPG templates, with no exception thrown, however SpaceEscape does work. As a side note, it would only run in Api 33 with the Bluetooth permissions as per the solution discussed here. The bluetooth solution is not required if just running/testing on Api 29.
To Reproduce Steps to reproduce the behavior:
Expected behavior Not error
Additional context SpaceEscape being the only project working, and only on the Api33 version is interesting outlier. SpaceEscape uses different Graphics Compositor settings which may hint at the different render texture(s) being set: (Also note it uses a different main shader Effect.)
New game project Graphics Compositor settings:
My speculation is the newer Android version just silently suppressed this error, which might be why you just get a black screen (though SpaceEscape working for Api 33 might debunk this theory).