You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
The quoted section from NativeScript/nativescript-cli#2486
is redundant and can fall off sync. It also makes the whole article rather messy
and difficult to read.
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+2-100
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Unable to start service com.apple.mobile.installation_proxy. Result code is: ...
38
38
```
39
39
40
40
**Solution:**
41
-
Try one of the following approaches:
41
+
Try one of the following approaches:
42
42
- The `Sync with this iPhone over Wi-Fi` option in iTunes on your machine should be disabled
43
43
- Disable your Wi-Fi and execute `tns device` (when your device is connected and disconnected). It is possible that some other device is connected to the same Wi-Fi and this causes confusion in the way CLI communicates to the devices. You can find more info on the issue [here](https://github.com/NativeScript/nativescript-cli/issues/1398).
44
44
@@ -82,102 +82,4 @@ The package manager service found that the device didn't have enough storage spa
82
82
83
83
**Solution:**
84
84
85
-
Solution provided by [KristiyanFxy](https://github.com/KristiyanFxy) a member of the NativeScript community. Link to original solution [here.](https://github.com/NativeScript/nativescript-cli/issues/2486#issuecomment-355299977
86
-
). The following explanation is a direct quote from his solution:
87
-
88
-
### 1. Black screen when running AVD emulator
89
-
90
-
#### Problem & Suspected reason
91
-
When I was trying to run an android emulator using AVD Manager, as Administrator, I was getting a back screen. The reason was that I did not have all the necessary Android SDK packets. This might be because I already had Visual Studio & c# Xamarin extension installed that after running `@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"` confused the hell out of my Android emulator.
92
-
93
-
#### Fix
94
-
1. Run AVD Manager as Administrator
95
-
2. Click on the Tools > Manage SDK...
96
-
3. Make sure you have all API version 23 (at least I went for 23) mobile packets > Install the once you don't have.
97
-
4. Download and install Intel HAXM (Link to Intel official site: **[here](https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm)**).
98
-
**Note:** You will notice HAXM is an actual option in AVD SDK Manager but it reads "Not Compatible with Windows"... don't worry, just download the executable from Intel's official website.
**Quick caveat:** If you do not install HAXM, you will see the following message when trying to run the emulator: "Please ensure Intel HAXM is properly Installed and usable. CPU acceleration status: HAXM is not installed on this machine"
5. After SDK and HAXM are download and installed, restart AVD Manager (again in Administrator mode).
106
-
6. Delete all Android Virtual devices (I did that because TNS will always target the highest available Android version & removed any confusion for further debugging).
107
-
7. In the "Device Definitions" tab > find "Nexus 7" > click on "Create AVD"
**Note:** I have plenty of RAM so I left the default RAM amount, but you might need to edit that for your specific system. That being said, I increase VM Heap to 512 because the virtual machine was not loading.
112
-
8. Click on Ok > Start...
113
-
9. Profit!
114
-
115
-
### 2. AVD Android emulator is laggy when running
116
-
117
-
#### Problem & Suspected reason
118
-
My uneducated assumption in my case the problem was forcing my old CPU I5-3750k to calculate polygons which the processor is not very successful at.
119
-
120
-
#### Fix
121
-
1. Run AVD Manager as Administrator
122
-
2. Click on your AVD device > Edit...
123
-
3. Enable "Use Host GPU" (also shown on the picture above)
124
-
4. Click "OK" > Start...
125
-
5. Profit!
126
-
127
-
### 3. `tns doctor` not finding any problems but `tns run android --timeout 300` times out with error.
128
-
129
-
#### Problem & Suspected reason
130
-
This was a tricky one and I have no idea what causes the problem but I have found a workaround (unless that is how NativeScript is intended to be used).
131
-
132
-
Now for this to work you will need to manually start your emulator and then instruct NativeScript to run your program.
133
-
134
-
What I noticed is that when the emulator is not running, executing `'tns devices` returns "Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again."
3. Open CMD/PS/Bash... as Administrator > CD \[project directory] > `tns run android --timeout 100`
145
-
146
-
**Note:** At this point you might find that the NativeScript is running to a **"Build Error"** and it is exiting. Now... that is documented here [#2092](https://github.com/NativeScript/nativescript-cli/issues/2092). I found that creating a fresh TNS project works best than amending package.json, but you are welcome to do either.
### 4. Command gradlew.bat failed with exit code 1.
153
-
154
-
#### Problem & Suspected reason
155
-
As explained by @Plamen5kov in ticket [#2092](https://github.com/NativeScript/nativescript-cli/issues/2092) the problem is due to conflicting jars.
156
-
157
-
#### Fix
158
-
Easiest fix is to build a new app from scratch and port your scripts. alternatively you can follow the steps from ticket [#2092](https://github.com/NativeScript/nativescript-cli/issues/2092) by @Pip3r4o
159
-
160
-
1. Open package.json
161
-
2. Delete `"tns-android": "^2.2.0"` from Dependencies
162
-
3. Delete `node_modules` and the `platforms` directories
163
-
4.`tns run android`
164
-
5. Profit!
165
-
166
-
### 5. **`tns run android` throws Java (javac) error.**
167
-
168
-
#### ## Problem & Suspected reason
169
-
This was caused by the installer skipping jdk8 installation because I already had it installed, unfortunately, the current installation was causing problems.
170
-
171
-
#### Fix
172
-
You will need to force install jdk8
173
-
174
-
1. Run CMD/Bash/PS... as Administrator
175
-
2.`choco install jdk8 -y`
176
-
**Note:** If you already have JDK installed, you might need to use the --force reserve word
177
-
3.`tns run android`
178
-
4. Profit!
179
-
180
-
### **Conclusion**
181
-
The problem is with the development environment, that being said I hope my comment will help in the future others.
Solution provided by [KristiyanFxy](https://github.com/KristiyanFxy) a member of the NativeScript community. Link to original solution [here](https://github.com/NativeScript/nativescript-cli/issues/2486#issuecomment-355299977).
0 commit comments