2017-10-07 166 views
0

嘗試使用Genymotion 2仿真器和Custom Phone - 7.0.0 - API 24 - 768x1280 - 7.0以及通過USB MotoG3 - 6.0.1插入的真實設備。在RN Android模擬器上取得外部資源失敗

在這兩種情況下,在外部託管的工作JSON API上獲取失敗。

"TypeError: Network request failed 
    at XMLHttpRequest.xhr.onerror (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:12473:16) 
    at XMLHttpRequest.dispatchEvent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:13376:35) 
    at XMLHttpRequest.setReadyState (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:15481:18) 
    at XMLHttpRequest.__didCompleteResponse (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:15337:14) 
    at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:15432:45 
    at RCTDeviceEventEmitter.emit (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:3958:35) 
    at MessageQueue.__callFunction (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:2090:42) 
    at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:1948:15 
    at MessageQueue.__guard (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:2062:9) 
    at MessageQueue.callFunctionReturnFlushedQueue (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:1947:12)" 

在ios模擬器上也是如此。報道如下

的問題並沒有幫助 https://github.com/facebook/react-native/issues/5222 https://github.com/facebook/react-native/issues/15100

我的問題是(我知道Java,但沒有足夠的Android) - 在哪裏尋找任何日誌/例外瞭解其失敗的真正原因。因爲API本身是功能性的並且與IOS模擬器一起工作。

+0

而同樣的錯誤在真實設備上,以及 –

回答