{"_id":"59bc03d41d2d8d001a3445ce","category":{"_id":"59bc03d31d2d8d001a344581","version":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-18T21:08:45.730Z","from_sync":false,"order":4,"slug":"develop","title":"Develop"},"parentDoc":null,"user":"584328a7c3fec61b001d17c6","project":"578c4badbd223d2000cc1441","version":{"_id":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":2,"createdAt":"2017-09-15T16:46:11.721Z","releaseDate":"2017-09-15T16:46:11.721Z","categories":["59bc03d31d2d8d001a34457e","59bc03d31d2d8d001a34457f","59bc03d31d2d8d001a344580","59bc03d31d2d8d001a344581","59bc03d31d2d8d001a344582","59bc03d31d2d8d001a344583","59bc284b7c3f420010f965e6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-03-24T23:14:03.096Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":19,"body":"This page documents some of the common scenarios that you might run into while developing on Viro. If you are facing an issue that is not covered here, please open an issue on our github [here](https://github.com/viromedia/viro/issues).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. My screen appears just black.\"\n}\n[/block]\nYour application could be missing keys. Make sure you include your key emailed to you when you signed up [here](http://www.viromedia.com/signup), in the index.android.js and index.ios.js files. \n[block:api-header]\n{\n  \"title\": \"2. My android app shows an old scene, when I restart the app.\"\n}\n[/block]\nThe android platform caches the scene from last run. If you are not seeing updates to the scene on code changes, hit reload using developer menu.\n[block:api-header]\n{\n  \"title\": \"3. My android app is crashing repeatedly while reloading scenes.\"\n}\n[/block]\nIf your app started crashing repeatedly after changing scenes, you may need to clear the application cache by either clearing data or by uninstalling and installing the app.\n[block:api-header]\n{\n  \"title\": \"4. React Developer menu does not appear on my android app.\"\n}\n[/block]\nIf you are developing on Cardboard and Nougat device, then make sure to set the debug flag in `ViroSceneNavigator` to true in your index.android.js file\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<ViroSceneNavigator apiKey=\\\"API_KEY_HERE\\\"\\n       initialScene={{scene: scene}}\\n       vrModeEnabled={this.props.vrMode}\\n       debug={this.props.debug} // set this to true\\n        />\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThe developer menu is not supported on Daydream.\n[block:api-header]\n{\n  \"title\": \"5. Certain Assets / Resources types are not loading in my application.\"\n}\n[/block]\nIf your application cannot find assets/resources in your project, it may be that you need to update the `rn-cli.config.js` and add the extension to `getAssetExts()`.\n[block:api-header]\n{\n  \"title\": \"6. I get an an error \\\"Can't connect to development server\\\".\"\n}\n[/block]\nThis error occurs when the Testbed app can't connect to your react package server on your local machine. Make sure your device and your desktop are on the same network. If they are and you are still unable to connect try the following:\n\n* Try using the ngrok endpoint if you are using the IP address in the testbed app. The ngrok endpoint is a tunnel that sits behind the ngrok domain. This way you avoid network issues when connecting to a local IP on a network which sometimes fails to resolve properly. In your packager logs this would be: xxxxx.ngrok.io. \n\n* Sometimes firewalls or security software can block outgoing traffic on your desktop or laptop. The packager server runs on port 8081 and it might be blocked from sending data.  If the above solutions don't work, then perhaps something is blocking data from being sent and needs to be turned off.\n\n* **(Android only)**If you are using Android try using reverse tethering provided by ADB. ADB(android debug bridge) is a versatile command-line tool provided by Google that allows you to communicate with your device.  See the instructions below for how to install ADB.\n[block:api-header]\n{\n  \"title\": \"Installing ADB(Android Only)\"\n}\n[/block]\nADB allows you to connect to your device via reverse tethering, enabling you to connect your android device and desktop via localhost. Download links are provided in the table below:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"ADB Download Links\",\n    \"h-1\": \"Download link\",\n    \"0-0\": \"**[Mac](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip)**\",\n    \"1-0\": \"**[Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip)**\",\n    \"2-0\": \"**[Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)**\"\n  },\n  \"cols\": 1,\n  \"rows\": 3\n}\n[/block]\nOnce you download ADB, follow the install instructions for your OS [here](http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378). \n\nAfter you install ADB and it's on your path do the following:\n* Connect your phone to your laptop/desktop via USB. If the enable debugging dialog pops up on the phone, tap yes. \n* In your terminal type `adb reverse tcp:8081 tcp:8081`. \n* Now run  'npm start' in your project folder to start the package server. \n* Once it's started in your testbed app, type 127.0.0.1. Your device should now connect to the package server on your laptop/desktop. You should be good to go!","excerpt":"","slug":"troubleshooting","type":"basic","title":"Troubleshooting"}
This page documents some of the common scenarios that you might run into while developing on Viro. If you are facing an issue that is not covered here, please open an issue on our github [here](https://github.com/viromedia/viro/issues). [block:api-header] { "type": "basic", "title": "1. My screen appears just black." } [/block] Your application could be missing keys. Make sure you include your key emailed to you when you signed up [here](http://www.viromedia.com/signup), in the index.android.js and index.ios.js files. [block:api-header] { "title": "2. My android app shows an old scene, when I restart the app." } [/block] The android platform caches the scene from last run. If you are not seeing updates to the scene on code changes, hit reload using developer menu. [block:api-header] { "title": "3. My android app is crashing repeatedly while reloading scenes." } [/block] If your app started crashing repeatedly after changing scenes, you may need to clear the application cache by either clearing data or by uninstalling and installing the app. [block:api-header] { "title": "4. React Developer menu does not appear on my android app." } [/block] If you are developing on Cardboard and Nougat device, then make sure to set the debug flag in `ViroSceneNavigator` to true in your index.android.js file [block:code] { "codes": [ { "code": "<ViroSceneNavigator apiKey=\"API_KEY_HERE\"\n initialScene={{scene: scene}}\n vrModeEnabled={this.props.vrMode}\n debug={this.props.debug} // set this to true\n />", "language": "javascript" } ] } [/block] The developer menu is not supported on Daydream. [block:api-header] { "title": "5. Certain Assets / Resources types are not loading in my application." } [/block] If your application cannot find assets/resources in your project, it may be that you need to update the `rn-cli.config.js` and add the extension to `getAssetExts()`. [block:api-header] { "title": "6. I get an an error \"Can't connect to development server\"." } [/block] This error occurs when the Testbed app can't connect to your react package server on your local machine. Make sure your device and your desktop are on the same network. If they are and you are still unable to connect try the following: * Try using the ngrok endpoint if you are using the IP address in the testbed app. The ngrok endpoint is a tunnel that sits behind the ngrok domain. This way you avoid network issues when connecting to a local IP on a network which sometimes fails to resolve properly. In your packager logs this would be: xxxxx.ngrok.io. * Sometimes firewalls or security software can block outgoing traffic on your desktop or laptop. The packager server runs on port 8081 and it might be blocked from sending data. If the above solutions don't work, then perhaps something is blocking data from being sent and needs to be turned off. * **(Android only)**If you are using Android try using reverse tethering provided by ADB. ADB(android debug bridge) is a versatile command-line tool provided by Google that allows you to communicate with your device. See the instructions below for how to install ADB. [block:api-header] { "title": "Installing ADB(Android Only)" } [/block] ADB allows you to connect to your device via reverse tethering, enabling you to connect your android device and desktop via localhost. Download links are provided in the table below: [block:parameters] { "data": { "h-0": "ADB Download Links", "h-1": "Download link", "0-0": "**[Mac](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip)**", "1-0": "**[Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip)**", "2-0": "**[Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)**" }, "cols": 1, "rows": 3 } [/block] Once you download ADB, follow the install instructions for your OS [here](http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378). After you install ADB and it's on your path do the following: * Connect your phone to your laptop/desktop via USB. If the enable debugging dialog pops up on the phone, tap yes. * In your terminal type `adb reverse tcp:8081 tcp:8081`. * Now run 'npm start' in your project folder to start the package server. * Once it's started in your testbed app, type 127.0.0.1. Your device should now connect to the package server on your laptop/desktop. You should be good to go!