2016-11-26 132 views
0

誰能告訴我,爲什麼即時得到這個錯誤:反應,原生的Android錯誤404

我的代碼是:

import React, { Component } from 'react'; 
import { 
AppRegistry, 
StyleSheet, 
Text, 
View, 
TextInput, 
Image, 
LinkingIOS, 
Navigator, 
WebView 

} from 'react-native'; 

export default class ReactNativeReactWebview extends Component { 
    render() { 
    return (

    <WebView 

     source={require('./index.html')} 
     javaScriptEnabled={true} 
    /> 


); 
} 
} 
AppRegistry.registerComponent('reactAndroid',()=>ReactNativeReactWebview); 

我的應用程序運行在模擬器不錯,但在命令行中得到錯誤....在這種PIC錯誤:

my error 404

回答

1

瀏覽器嘗試在默認情況在favicon.ico路徑來獲取圖標。如果您的WebView按預期呈現,我會說它應該沒問題。

+0

我沒有在我的項目文件中的favicon.ico路徑! –

+0

這就是你得到錯誤的原因。瀏覽器嘗試獲取圖標並失敗,因此打包程序返回「未找到文件」(404)。但是這不會以任何方式影響您的WebView,因此將它保留原樣是安全的。 – martinarroyo

+0

thnx you alot @martinarroyo :) –