Posts

Showing posts with the label react-native

Configure Proxy Settings for CMD.EXE, WinHttp

Image
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\lenger>netsh netsh>winhttp netsh winhttp>set proxy /? Usage: set proxy [proxy-server=] [bypass-list=] Parameters: Tag Value proxy-server - proxy server for use for http and/or https protocol bypass-list - a list of sites that should be visited bypassing the proxy (use " " to bypass all short name hosts) Examples: set proxy myproxy set proxy myproxy:80 " ;bar" set proxy proxy-server="http=myproxy;https=sproxy:88" bypass-list="*.foo.com" netsh winhttp> set HTTP_PROXY=server:port set HTTPS_PROXY=server:port Refer https://technet.microsoft.com/en-us/library/bb430772(v=exchg.141).aspx

install and build your first React Native app on windows

Image
Installing Chocolatey with cmd.exe @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" Installing Node, Python2 and JDK with Chocolatey choco install -y nodejs.install python2 jdk8 Install The React Native CLI npm install -g react-native-cli Setup Android Studio Create Virtual Device Create New Application react-native init AwesomeProject Run android Launch your AVD before run-android react-native run-android If every works well, below is your final result: Refer https://facebook.github.io/react-native/docs/getting-started.html https://chocolatey.org/install Troubleshooting page npm proxy set run-android connection timeout unable to load index.android.bundle

Unable to load script from assets index.android.bundle

Image
Solution mkdir android/app/src/main/assets react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res Run react-native run-android Total time: 23.641 secs 'adb' is not recognized as an internal or external command, operable program or batch file. Starting the app (C:\Users\lenger\AppData\Local\Android\Sdk/platform-tools/adb shell am start -n com.webrowser/com.webrowser.MainActivity... Starting: Intent { cmp=com.webrowser/.MainActivity }

react-native run-android : Connection timed out

Error Log Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip Exception in thread "main" java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.protocol.https.HttpsClient. (Unknown

npm config http/https proxy

npm --proxy http://username:password@server :port install packagename npm config set proxy http://username:password@server :port npm config set https-proxy http://username:password@server :port   npm config set strict-ssl false npm config set registry " http://registry.npmjs.org/ " npm config rm proxy npm config rm https-proxy