Error on mobile

Good afternoon guys,

Every time that i try to open my project on my sister’s and mine phone (Samsung - Android), the following error appears:

Any idea of what is happen?

Any chance you can share the project or another project that shows the same problem?

Does this error only occur on mobile? Does it work on desktop?
If so, what model of phone, version of the browser and OS version?

It works fine on following devices:

Samsung Galaxy S7 | Android 7.0 | Chrome 67.0
Samsung Galaxy S8+ | Android 8.0 | Chrome 67.0

And not working on that:

Samsung Galaxy J3, Android 5.1.1 - Chrome 67.0

Its my company software so is a bit tricky to give access, but if we cant fix the problem with this information i’ll try to give you access.

It be odd for it be device specific.

I would try a minimal project that showcases the problem. I don’t have a device to test at the J3 level so I wouldn’t be able to help regardless.

Things I would look at:
Is it just that one device? Do you have access to another J3 or similar device?
Is it related to WebGL2 support? Use http://webglreport.com/ to check
Try debugging through the code and see if you can find the earliest point of failure
Are there any other errors in the console with Chrome devtools?
Does the file size of the model matter?

Hello again,

After debugging a little, I saw that stretch that is causing the problem:

    this.app.assets.loadFromUrl( url, 'binary', function (err, asset) {
         // glb becomes null at older androids only
         var glb = asset.resource;
         loadGlb(glb, this.app.graphicsDevice, function (roots) {
         ....

In Androids with version 6.0 or earlier, the asset.resource variable returns the null value.
i have already tested on similar devices with Android 6.0 or older and all presents the same error (all of these have support for webgl)

Another information: I’m testing here and found out that if itry to access asset.resources.length, it returns 1 on both device systems (windows and android). This means that there is a value (ArrayBuffer) inside the asset variable, but when I try to access it, the value returned is null (android only).

Are you saying that both asset.resource and asset.resources[0] are null?

Yes, only on mobile these two bocomes null
Another information: The both devices where the error occur does’nt support the webgl 2.0

Any errors on the Chrome devtools console or from err in the callback?

What happens if you force WebGL 1 on the project and test on the S7 and S8?

I’ve tried to debug on Android, but without success.
How can i force webgl1?

Just want to check, you haven’t been able to debug Android even by following these steps? https://developers.google.com/web/tools/chrome-devtools/remote-debugging/

Forcing WebGL 1 should be done via unticking “Prefer WebGL2” in the settings of the editor.

Finally, after 12 hour searching for clues of why it is not working i found out. I’m loading the GLB file from a server that uses SSL. Older Androids does’n complete the url with “https” if necessary, but the newer versions complete it. Adding this prefix to the player URL make the GLB to load properly

1 Like

For something like that, I would expect an error to be thrown on the console or it to show on the network tab of Chrome devtools.

Did you ever get the Android debugging working?

I tried, but my computer doesn’t recognize my cell phone even in usb debugging mode

You may need to install the drivers from Google. https://developer.android.com/studio/run/win-usb

I Already installed it

That’s a pain, remote debugging is incredibly useful :confused:

Stupid question: Is the USB cable you are using capable of transferring data as well as power? Some cables (especially cheap ones) will only transfer power.

Looks like the original issue is resolved:

Yes, the cable is capable of transferring data

Thanks… i need to write something to reach 20 characters kkk