Skip to content

Commit

Permalink
docs: android version update with matrix CLI and troubleshooting (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpoole committed Mar 14, 2024
1 parent e303eb8 commit 1745cde
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"androidLiveUpdatesVersion": "0.5.0",
"rnVersion": "0.5.1",
"iosVersion": "0.10.0",
"androidVersion": "0.8.4",
"androidVersion": "0.9.0",
"version": "0.9.0"
}
46 changes: 46 additions & 0 deletions website/docs/cli/commands/serve-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,49 @@ portals serve android \
- `--portal-name` **(string)** The name of the target Portal. (default "PORTAL")
- `--config` **(string)** config file (default $PWD/.portals.yaml)

### Troubleshooting connectivity issues

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.

#### Make sure your application supports Internet connectivity

The Android manifest file should contain the following permission

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

#### Cleartext web content

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:

- Add `android:usesCleartextTraffic="true"` to your Android manifest `application` tag, or
- 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.

#### Emulator network troubleshooting

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.

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.

:::note

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`.

:::

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:

To link `localhost:8080` on your emulator to `localhost:8080` on your development machine, open the terminal and run:

```sh
$ANDROID_HOME/platform-tools/adb reverse tcp:8080 tcp:8080
```

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:

```bash
portals serve android \
--application /path/to/your/android-app.apk \
--dev-server http://127.0.0.1:8080
```
53 changes: 27 additions & 26 deletions website/docs/for-android/version-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,30 @@ For more information refer to the Gradle documentation pages:

## SDK Version Compatibility Matrix

| Android SDK | Web Plugin Version | Compiled Capacitor Version | Compatible Capacitor Versions | Compatible Live Updates Versions |
| :----: | :----: | :----: | :----: | :----: |
| 0.8.4 | 0.9.0 | 5.7.+ | 5.0.3 - 5.7.2 | 0.5.+ |
| 0.8.3 | 0.8.1 | 5.5.+ | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
| 0.8.2 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
| 0.8.1 | 0.8.1 | 5.4.2 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
| 0.8.0 | 0.8.1 | 5.0.3 | 5.0.3 - 5.7.2 | 0.0.5 - 0.4.1 |
| 0.7.5 | 0.7.1 | 4.7.3 | 4.7.0 - 4.8.0 | 0.0.5 - 0.4.1 |
| 0.7.4 | 0.7.1 | 4.7.0 | 4.7.0 - 4.8.0 | 0.0.5 - 0.4.1 |
| 0.7.3 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 |
| 0.7.2 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 |
| 0.7.1 | 0.7.0 | 4.6.1 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 |
| 0.7.0 | 0.7.0 | 4.5.0 | 4.4.0 - 4.6.3 | 0.0.5 - 0.4.1 |
| 0.6.4 | 0.6.0 | 3.9.0 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.6.3 | 0.6.0 | 3.7.0 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.6.2 | 0.6.0 | 3.5.1 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.6.1 | 0.6.0 | 3.5.1 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.6.0 | 0.6.0 | 3.5.1 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.5.1 | 0.5.0 | 3.5.1 | 3.5.1 - 3.9.0 | 0.0.5 - 0.4.1 |
| 0.5.0 | 0.5.0 | 3.4.1 | 3.3.0 - 3.5.0 | 0.0.5 - 0.4.1 |
| 0.4.1 | 0.4.1 | 3.4.0 | 3.3.0 - 3.5.0 | 0.0.5 - 0.4.1 |
| 0.3.1 | 0.3.1 | 3.3.3 | 3.3.0 - 3.5.0 | 0.0.5 - 0.4.1 |
| 0.3.0 | 0.3.0 | 3.3.2 | 3.3.0 - 3.5.0 | 0.0.5 - 0.4.1 |
| 0.2.2 | 0.2.2 | 3.2.5 | 3.2.2 - 3.2.5 | 0.0.5 - 0.4.1 |
| 0.2.1 | 0.2.1 | 3.2.4 | 3.2.2 - 3.2.5 | 0.0.5 - 0.4.1 |
| 0.2.0 | 0.2.0 | 3.2.2 | 3.2.2 - 3.2.5 | 0.0.5 - 0.4.1 |
| Android SDK | Web Plugin Version | Compiled Capacitor Version | Compatible Capacitor Versions | Compatible Live Updates Versions | Portals CLI |
| :----: | :----: | :----: | :----: | :----: | :----: |
| 0.9.0 | 0.9.0 | 5.7.+ | 5.0.3 - 5.7.2 | 0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