1
resposta

Codigo não atualiza

Olá, não consigo entender porque meu codigo esta dando esse erro se a imagem nem esta mais no codigo...

o erro :

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

Body:
{"originModulePath":"/home/paris/InstaluraMobile/App.js","targetModuleName":"./resources/img/alura.png","message":"Unable to resolve module `./resources/img/alura.png` from `/home/paris/InstaluraMobile/App.js`: The module `./resources/img/alura.png` could not be found from `/home/paris/InstaluraMobile/App.js`. Indeed, none of these files exist:\n  * `alura.png`\n  * `/home/paris/InstaluraMobile/resources/img/alura.png/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`","errors":[{"description":"Unable to resolve module `./resources/img/alura.png` from `/home/paris/InstaluraMobile/App.js`: The module `./resources/img/alura.png` could not be found from `/home/paris/InstaluraMobile/App.js`. Indeed, none of these files exist:\n  * `alura.png`\n  * `/home/paris/InstaluraMobile/resources/img/alura.png/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`"}],"name":"Error","stack":"Error: Unable to resolve module `./resources/img/alura.png` from `/home/paris/InstaluraMobile/App.js`: The module `./resources/img/alura.png` could not be found from `/home/paris/InstaluraMobile/App.js`. Indeed, none of these files exist:\n  * `alura.png`\n  * `/home/paris/InstaluraMobile/resources/img/alura.png/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`\n    at ModuleResolver.resolveDependency (/home/paris/InstaluraMobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:697)\n    at ResolutionRequest.resolveDependency (/home/paris/InstaluraMobile/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)\n    at DependencyGraph.resolveDependency (/home/paris/InstaluraMobile/node_modules/metro/src/node-haste/DependencyGraph.js:222:485)\n    at Object.resolve (/home/paris/InstaluraMobile/node_modules/metro/src/lib/transformHelpers.js:149:25)\n    at dependencies.map.result (/home/paris/InstaluraMobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:316:29)\n    at Array.map (<anonymous>)\n    at resolveDependencies (/home/paris/InstaluraMobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:312:16)\n    at /home/paris/InstaluraMobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:169:33\n    at Generator.next (<anonymous>)\n    at step (/home/paris/InstaluraMobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:271:307)"}
processBundleResult
    BundleDownloader.java:296
access$200
    BundleDownloader.java:37
onResponse
    BundleDownloader.java:174
execute
    RealCall.java:153
run
    NamedRunnable.java:32
runWorker
    ThreadPoolExecutor.java:1113
run
    ThreadPoolExecutor.java:588
run
    Thread.java:818

codigo :

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Image, Dimensions} from 'react-native';

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});


const width = Dimensions.get('screen').width;

export default class InstaluraMobile extends Component {
    render() {
        const fotos = [
            {id: 1, usuario: 'rafael'},
            {id: 2, usuario: 'alberto'},
            {id: 3, usuario: 'vitor'}
        ];

        return (
            <FlatList style={{marginTop: 20}}
                keyExtractor={item => item.id}
                data={fotos}
                renderItem={ ({item}) =>
                    <View>
                        <Text>{item.usuario}</Text>
                        <Image source={require('./resources/img/send.png')}
                            style={{width: width, height: width}} />        
                    </View>
                }
            />
        );
    }
}




1 resposta

Estranho isso parismollochristondis, você tentou dar restart no react-native pra ver se não foi por que ele se perdeu na compilação?