MLGraphicsBeginFrame Complaint: error number 5

I have moved my magic leap development environment to another PC, and followed everything in the setup overview for native development. Now I am getting this error for the simple_gl_app sample.

I am using the 1.1.0-dev1 SDK sample and documentation
Version 1.1.0-dev1
Build B3E.221020.13-R.039
Android API Level 29

I had this error before, when I used a mismatched version of the SDK and the operating system.
but this time I am very sure the SDK I have are 1.1.0-dev1 and the OS version should match that one.

I also made sure that I followed everything in the Setup overview, so I have NDK version 25.0.8.

Hi @a.al-darraji,

Can you please write the full error message information you received? Are you referring to MLGraphicsBeginFrameEx?

If it is not a serious hindrance to your development process, we also suggest updating to the latest OS and SDK release (OS 1.1.0), as the API throwing this error was updated in the 1.1.0-dev-2 release which you can find release notes for here.

Thank you for your reply,
Yes I am talking about: MLGraphicsBeginFrameEx inside the magic leap sample, gl_simple_app
I have the following code (copied from the sample directly):

MLResult result = MLGraphicsBeginFrameEx(data->graphics_client, &frame_params, &frame_info);
  if (MLResult_Ok != result) {
    if(MLResult_Timeout != result) {
      ALOGE("MLGraphicsBeginFrame complained: %d", result);
    }
    return;
  }

To be sure, I deleted the entire mlsdk\v1.1.0-dev1 directory, and then re-installed the samples and the SDK from the package manager, and still got the same error. (I did not change a single line in the code for that matter), again I never had this problem with a different computer, is there anything, related to android SDK and android studio maybe that may cause such issue? (I did go through the setup overview and both command line and android studio setup to make sure I have everything installed, with the correct version number, in the right path)

I will consider the update for sure, but is there anything else I can doto provide you with any extra information?

@a.al-darraji
Can you try the following and see if your error has resolved:

  • Try setting the focus_distance parameter to be the same as the far_clip parameter
  • check to see if you environment variable is pointing to the correct SDK - it's possible it is still referencing a newer one, this error is known to happen when a mismatch of newer SDK and older ML2 OS version

Thank you very much for your reply, it seems this was an issue with Android Studio itself.
Even after entirely uninstalling the SDK, reinstall the correct one, somehow android studio kept referencing it even after I cleaned the project, I can confirm this, because I was able build the sample apps through the command line workflow, but not Android Studio.

I will close this issue, because it was solved by using the command line workflow.