babakcode / o3d

The Flutter 3D objects easy controller ( glb format )
https://pub.dev/packages/o3d
BSD 3-Clause "New" or "Revised" License
32 stars 12 forks source link

Cannot use origin without a scheme #1

Closed antogalli closed 8 months ago

antogalli commented 8 months ago

Loading the GLB from asset folder i cant view on Android Build:

Loading like this: O3D( src: 'assets/3d/refix_spray_ORBIT_cam.glb', controller: o3dcontroller, ar: false, autoPlay: true, autoRotate: true, ),

E/flutter ( 2836): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Cannot use origin without a scheme: assets/3d/refix_spray_ORBIT_cam.glb

ModelViewerState._initProxy. package:model_viewer_plus/src/model_viewer_plus_mobile.dart:289

babakcode commented 8 months ago

Please share your file, I will check it.

antogalli commented 8 months ago

Nothing Special. I Got a page with scaffold, and your Widget. This is the call in the body:

O3D( src: 'assets/3d/refix_spray_ORBIT_cam.glb', controller: o3dcontroller, ar: false, autoPlay: true, autoRotate: true, ),

This is the asset of my pubspec: [...] assets:

babakcode commented 8 months ago

Some Glb files are not exported correctly by their creators, so I'm going to get your file to test it, but it seems to have an error in release mode, I'll fix that. Please test it in debug mode and let me know.

antogalli commented 8 months ago

I got the same error with the Astonaut.glb file. Anyway the error Is catched only on Android. In Web mode it works fine....

Il mer 15 nov 2023, 17:20 Babak Gahremanzadeh @.***> ha scritto:

Some Glb files are not exported correctly by their creators, so I'm going to get your file to test it, but it seems to have an error in release mode, I'll fix that. Please test it in debug mode and let me know.

— Reply to this email directly, view it on GitHub https://github.com/babakcode/o3d/issues/1#issuecomment-1812848131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4FULXGYIBX6OL5HVXNF6LYETTTXAVCNFSM6AAAAAA7MN5OYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJSHA2DQMJTGE . You are receiving this because you authored the thread.Message ID: @.***>

babakcode commented 8 months ago

Probably, You don't add clear text traffic in the Android manifest. Put this code clearText Traffic="true" inside the android manifest.

antogalli commented 8 months ago

Yes, i put it in manifest:

android:usesCleartextTraffic="true"

babakcode commented 8 months ago

Dear @antogalli,

I've addressed the Android and web release bugs and would appreciate it if you could review the updated version of the O3D package. For a thorough check on the Android platform, please test it on a real device.

antogalli commented 8 months ago

I'm trying it now. I don't receive the error anymore, but the model is not renderized if present in Assets. Works only on remote GLB. Tested in Debug Mode Android APILEVEL 33