mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
@@ -12,8 +12,8 @@ sudo chown <span class="token operator">-</span>R $USER <span class="token opera
|
||||
<span class="token string">'RCTImage'</span><span class="token punctuation">,</span>
|
||||
<span class="token string">'RCTNetwork'</span><span class="token punctuation">,</span>
|
||||
<span class="token string">'RCTWebSocket'</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">]</span></div><p>Next, make sure you have run <code>pod install</code> and that a <code>Pods/</code> directory has been created in your project with React installed. CocoaPods will instruct you to use the generated <code>.xcworkspace</code> file henceforth to be able to use these installed dependencies.</p><p>If you are adding React manually, make sure you have included all the relevant dependencies, like <code>RCTText.xcodeproj</code>, <code>RCTImage.xcodeproj</code> depending on the ones you are using. Next, the binaries built by these dependencies have to be linked to your app binary. Use the <code>Linked Frameworks and Binaries</code> section in the Xcode project settings. More detailed steps are here: <a href="https://facebook.github.io/react-native/docs/linking-libraries-ios.html#content" target="_blank">Linking Libraries</a>.</p><h5><a class="anchor" name="argument-list-too-long-recursive-header-expansion-failed"></a>Argument list too long: recursive header expansion failed <a class="hash-link" href="#argument-list-too-long-recursive-header-expansion-failed">#</a></h5><p>In the project's build settings, <code>User Search Header Paths</code> and <code>Header Search Paths</code> are two configs that specify where Xcode should look for <code>#import</code> header files specified in the code. For Pods, CocoaPods uses a default array of specific folders to look in. Verify that this particular config is not overwritten, and that none of the folders configured are too large. If one of the folders is a large folder, Xcode will attempt to recursively search the entire directory and throw above error at some point.</p><p>To revert the <code>User Search Header Paths</code> and <code>Header Search Paths</code> build settings to their defaults set by CocoaPods - select the entry in the Build Settings panel, and hit delete. It will remove the custom override and return to the CocoaPod defaults.</p><h2><a class="anchor" name="unable-to-connect-to-development-server"></a>Unable to connect to development server <a class="hash-link" href="#unable-to-connect-to-development-server">#</a></h2><h5><a class="anchor" name="ios"></a>iOS <a class="hash-link" href="#ios">#</a></h5><p>Ensure that you are on the same WiFi network as your computer. If you're using a cell data plan, your phone can't access your computer's local IP address.</p><h5><a class="anchor" name="android"></a>Android <a class="hash-link" href="#android">#</a></h5><p>You need to run <code>adb reverse tcp:8081 tcp:8081</code> to forward requests from the device to your computer. This works only on Android 5.0 and newer.</p><h4><a class="anchor" name="module-that-uses-websocket-throws-exception"></a>Module that uses <code>WebSocket</code> throws exception <a class="hash-link" href="#module-that-uses-websocket-throws-exception">#</a></h4><p>React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through <code>require('react-native')</code>. If you load another module that requires WebSockets, be sure to load/require it after react-native.</p><p>So:</p><div class="prism language-javascript"><span class="token keyword">var</span> React <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'react-native'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">var</span> Firebase <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'firebase'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><p>In the case of Firebase requiring firebase <em>before</em> react-native will result in a: 'No transports available' redbox.</p></div><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="center">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
<span class="token punctuation">]</span></div><p>Next, make sure you have run <code>pod install</code> and that a <code>Pods/</code> directory has been created in your project with React installed. CocoaPods will instruct you to use the generated <code>.xcworkspace</code> file henceforth to be able to use these installed dependencies.</p><p>If you are adding React manually, make sure you have included all the relevant dependencies, like <code>RCTText.xcodeproj</code>, <code>RCTImage.xcodeproj</code> depending on the ones you are using. Next, the binaries built by these dependencies have to be linked to your app binary. Use the <code>Linked Frameworks and Binaries</code> section in the Xcode project settings. More detailed steps are here: <a href="https://facebook.github.io/react-native/docs/linking-libraries-ios.html#content" target="_blank">Linking Libraries</a>.</p><h5><a class="anchor" name="argument-list-too-long-recursive-header-expansion-failed"></a>Argument list too long: recursive header expansion failed <a class="hash-link" href="#argument-list-too-long-recursive-header-expansion-failed">#</a></h5><p>In the project's build settings, <code>User Search Header Paths</code> and <code>Header Search Paths</code> are two configs that specify where Xcode should look for <code>#import</code> header files specified in the code. For Pods, CocoaPods uses a default array of specific folders to look in. Verify that this particular config is not overwritten, and that none of the folders configured are too large. If one of the folders is a large folder, Xcode will attempt to recursively search the entire directory and throw above error at some point.</p><p>To revert the <code>User Search Header Paths</code> and <code>Header Search Paths</code> build settings to their defaults set by CocoaPods - select the entry in the Build Settings panel, and hit delete. It will remove the custom override and return to the CocoaPod defaults.</p><h2><a class="anchor" name="unable-to-connect-to-development-server"></a>Unable to connect to development server <a class="hash-link" href="#unable-to-connect-to-development-server">#</a></h2><h5><a class="anchor" name="ios"></a>iOS <a class="hash-link" href="#ios">#</a></h5><p>Ensure that you are on the same WiFi network as your computer. If you're using a cell data plan, your phone can't access your computer's local IP address.</p><h5><a class="anchor" name="android"></a>Android <a class="hash-link" href="#android">#</a></h5><p>You need to run <code>adb reverse tcp:8081 tcp:8081</code> to forward requests from the device to your computer. This works only on Android 5.0 and newer.</p><h2><a class="anchor" name="module-that-uses-websocket-such-as-firebase-throws-an-exception"></a>Module that uses <code>WebSocket</code> (such as Firebase) throws an exception <a class="hash-link" href="#module-that-uses-websocket-such-as-firebase-throws-an-exception">#</a></h2><p>React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through <code>require('react-native')</code>. If you load another module that requires WebSockets, be sure to load/require it after react-native.</p><p>So:</p><div class="prism language-javascript"><span class="token keyword">var</span> React <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'react-native'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">var</span> Firebase <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'firebase'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><p>Requiring firebase <em>before</em> react-native will result in a 'No transports available' redbox.</p><p>Discovered thanks to issue <a href="https://github.com/facebook/react-native/issues/3645" target="_blank">#3645</a>. If you're curious, the polyfills are set up in <a href="https://github.com/facebook/react-native/blob/master/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js" target="_blank">InitializeJavaScriptAppEngine.js</a>.</p></div><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="center">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
Reference in New Issue
Block a user