Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
React Native says files don't exist

So, I'm new to React Native, and I'm trying to build out a basic app, but every time I launch it on my android emulator, I get a syntax error telling me that 'none of these files exist" and it is referring to an image. Here is a screen capture of the emulator, as well as my vs code workspace. emulator and vs code worksapce

Here is the code if anyone wants to copy it and mess with it.

WelcomeWindow.js:

import React from 'react';
import { ImageBackground } from 'react-native-web';

function WelcomeWindow(props) {
    return (
        <ImageBackground 
        style={styles.background}
        source={require("../assets/background.jpg")}>
            
        </ImageBackground>
    );
}
const styles = StyleSheet.create({
    background: {
        flex: 1,
    }
})

export default WelcomeWindow;

App.js:

import WelcomeWindow from './app/screen/WelcomeWindow';

export default function App() {
  return (
    <WelcomeWindow />
  );
}

I'm certain the path is correct, I'm thinking this is more of a bug somewhere, and I don't really know how to fix it. I've tried looking for a solution, and I've come across a sources saying this is specifically an issue when using android studio, which I am using. Again, I'm not sure about that. If anyone can help me out, it would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I figured out what was going on. For some reason, the automatic import for ImageBackground is from react-native-web.

import React from 'react';
import { ImageBackground } from 'react-native-web';

It should only be react-native.

import React from 'react';
import { ImageBackground } from 'react-native';

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!