2016-11-22 92 views
3

我升級到React Native v0.37。在iPhone模擬器工作正常,但試圖在設備上運行應用程序時出現錯誤:升級到React Native後,無法在iOS設備上運行應用0.37

[fatal][tid:main] No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.unsanitizedScriptURLString:((null)) 

有沒有人有一個線索,爲什麼?

非常感謝您的幫助。

+0

現在工作正常。很難說我做了什麼,可能運行乾淨並重新啓動服務器。很難說,但現在運行良好。 – user1875631

+0

到目前爲止運氣還不錯?我遇到了同樣的問題。運行react-native 0.35.0。 – jankoritak

+0

沒有,對不起,沒有更多的信息,除了在xcode中清理項目,並重新啓動服務器。 – user1875631

回答

1

確保您允許本地主機在你的Info.plist

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSExceptionDomains</key> 
    <dict> 
     <key>localhost</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> 
      <true/> 
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> 
      <true/> 
     </dict> 
    </dict> 
</dict> 
+0

謝謝傑克。是的,情況已經如此。 – user1875631

1

OK,所以我升級反應原住民0.38後再次有問題。

我跑了「react-native bundle --dev false --assets-dest ./ios --entry-file index.ios.js --platform ios --bundle -output ios/main.jsbundle」捆綁在一個乾淨的方式,並發現有一個由巴貝爾插件配置問題引起的錯誤。清理我的.babelrc文件後,包裝運行良好。然後它生成main.jsbundle,並且您必須將其添加到xcode中的項目中。之後,編譯運行良好。

相關問題