Skip to content

Commit 1745cde

Browse files
authored
docs: android version update with matrix CLI and troubleshooting (#269)
1 parent e303eb8 commit 1745cde

File tree

3 files changed

+74
-27
lines changed

3 files changed

+74
-27
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"androidLiveUpdatesVersion": "0.5.0",
77
"rnVersion": "0.5.1",
88
"iosVersion": "0.10.0",
9-
"androidVersion": "0.8.4",
9+
"androidVersion": "0.9.0",
1010
"version": "0.9.0"
1111
}

website/docs/cli/commands/serve-android.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,49 @@ portals serve android \
8686
- `--portal-name` **(string)** The name of the target Portal. (default "PORTAL")
8787
- `--config` **(string)** config file (default $PWD/.portals.yaml)
8888

89+
### Troubleshooting connectivity issues
90+
91+
The Android emulator should be able to reach web servers running on the host machine through the IP address `10.0.2.2`. This sometimes may not work due to firewall policies, VPN settings, or other environmental changes. If you are having trouble connecting to your local web server from an emulator, try these troubleshooting steps.
92+
93+
#### Make sure your application supports Internet connectivity
94+
95+
The Android manifest file should contain the following permission
96+
97+
```xml
98+
<uses-permission android:name="android.permission.INTERNET" />
99+
```
100+
101+
#### Cleartext web content
102+
103+
If you are testing with an http server you may encounter an issue displaying a cleartext web page due to the default Android security settings. There are two ways to permit this content to load:
104+
105+
- Add `android:usesCleartextTraffic="true"` to your Android manifest `application` tag, or
106+
- Create a more narrowly scoped [Network Security Config](https://developer.android.com/privacy-and-security/security-config#CleartextTrafficPermitted) that permits cleartext traffic on your specific test domain only.
107+
108+
#### Emulator network troubleshooting
109+
110+
If the local web server fails to load with errors like `net::ERR_CACHE_HIT` or `net::ERR_CONNECTION_REFUSED`, you may have network settings preventing the emulator/device from using Android’s loopback address. One way to confirm if this is your problem is to try loading your local web server from the emulator web browser.
111+
112+
Double check that your local web server is actually running, then open Chrome in the emulator and go to the URL for your web app. If it loads, then the issue is related to your app specifically. If it does not load, then the emulator as a whole is having issues connecting to the web server on your local machine through the virtual network.
113+
114+
:::note
115+
116+
Reminder: the emulator does not reach your local development machine through the `localhost` url, as this is the loopback address for the emulator virtual machine itself. The IP address for your local machine from the emulator is `10.0.2.2`.
117+
118+
:::
119+
120+
If you are unable to reach your web server, try creating a proxy connection through the Android Debug Bridge app (adb). This is done using the terminal. For example:
121+
122+
To link `localhost:8080` on your emulator to `localhost:8080` on your development machine, open the terminal and run:
123+
124+
```sh
125+
$ANDROID_HOME/platform-tools/adb reverse tcp:8080 tcp:8080
126+
```
127+
128+
This will create a proxy through to the emulator and should allow the web content to load on the emulator through `localhost:8080` in the emulator web browser. Since the Portals CLI tries to be helpful by changing `localhost` to `10.0.2.2` in your app dev-server setting, you can force the localhost IP in your app by setting the development server to `127.0.0.1`, such as:
129+
130+
```bash
131+
portals serve android \
132+
--application /path/to/your/android-app.apk \
133+
--dev-server http://127.0.0.1:8080
134+
```

website/docs/for-android/version-matrix.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,30 @@ For more information refer to the Gradle documentation pages:
6464

6565
## SDK Version Compatibility Matrix
6666

67-
| Android SDK | Web Plugin Version | Compiled Capacitor Version | Compatible Capacitor Versions | Compatible Live Updates Versions |
68-
| :----: | :----: | :----: | :----: | :----: |
69-
| 0.8.4 | 0.9.0 | 5.7.+ | 5.0.3 - 5.7.2 | 0.5.+ |
70-
| 0.8.3 | 0.8.1 | 5.5.+ | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
71-
| 0.8.2 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
72-
| 0.8.1 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
73-
| 0.8.0 | 0.8.1 | 5.0.3 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
74-
| 0.7.5 | 0.7.1 | 4.7.3 | 4.7.0 - 4.8.0 | 0.0.5 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.2.5 | 0.0.5 - 0.4.1 |
92-
| 0.2.0 | 0.2.0 | 3.2.2 | 3.2.2 - 3.2.5 | 0.0.5 - 0.4.1 |
67+
| Android SDK | Web Plugin Version | Compiled Capacitor Version | Compatible Capacitor Versions | Compatible Live Updates Versions | Portals CLI |
68+
| :----: | :----: | :----: | :----: | :----: | :----: |
69+
| 0.9.0 | 0.9.0 | 5.7.+ | 5.0.3 - 5.7.2 | 0.5.+ | 0.3.0 |
70+
| 0.8.4 | 0.9.0 | 5.7.+ | 5.0.3 - 5.7.2 | 0.5.+ | - |
71+
| 0.8.3 | 0.8.1 | 5.5.+ | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 | - |
72+
| 0.8.2 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 | - |
73+
| 0.8.1 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 | - |
74+
| 0.8.0 | 0.8.1 | 5.0.3 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 | - |
75+
| 0.7.5 | 0.7.1 | 4.7.3 | 4.7.0 - 4.8.0 | 0.0.5 - 0.4.1 | - |
76+
| 0.7.4 | 0.7.1 | 4.7.0 | 4.7.0 - 4.8.0 | 0.0.5 - 0.4.1 | - |
77+
| 0.7.3 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 | - |
78+
| 0.7.2 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 | - |
79+
| 0.7.1 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 | - |
80+
| 0.7.0 | 0.7.0 | 4.5.0 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 | - |
81+
| 0.6.4 | 0.6.0 | 3.9.0 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 | - |
82+
| 0.6.3 | 0.6.0 | 3.7.0 | 3.5.1 - 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