Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not load Car.fbx: Call to function 'ExpoAsset.downloadAsync' has been rejected. #3383

Open
ahazem-dev opened this issue Oct 23, 2024 · 0 comments

Comments

@ahazem-dev
Copy link

Complete error message

 (NOBRIDGE) ERROR  Error: Could not load Car.fbx: Call to function 'ExpoAsset.downloadAsync' has been rejected.
→ Caused by: Unable to download asset from url: Car.fbx

My code looks like

import { OrbitControls, useFBX } from '@react-three/drei/native';
import { Canvas } from '@react-three/fiber/native';

// Load FBX Model Function
function CarModel() {
  const fbx = useFBX('Car.fbx')
  return <primitive object={fbx} scale={0.01} />;
}

export default function CanvasView() {
  return (
    <Canvas style={{ flex: 1 }}>
      {/* Add ambient light and directional light */}
      <ambientLight intensity={0.3} />
      <directionalLight position={[10, 10, 10]} intensity={1.5} />

      {/* <Suspense fallback={<Loader/>}> */}
        {/* Load the FBX model */}
        <CarModel />
      {/* </Suspense> */}

      {/* Orbit controls to rotate/zoom the model */}
      <OrbitControls enableZoom={true} />
    </Canvas>
  );
}

Component location and model location are:
Screenshot 2024-10-23 at 5 27 23 PM

The result on an emulator is:

Screenshot 2024-10-23 at 5 30 41 PM

Assets extension in metro.config.js are:
Screenshot 2024-10-23 at 5 33 39 PM

what can be the problem?
if you do not understand any of the points, please ask follow-up questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant