Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] update android sdk version #37445

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:108
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
image: ghcr.io/project-chip/chip-build-android:112
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: ghcr.io/project-chip/chip-build-java:104
image: ghcr.io/project-chip/chip-build-java:112
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:108
image: ghcr.io/project-chip/chip-build-android:112
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
Expand Down
22 changes: 11 additions & 11 deletions docs/platforms/android/android_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ downloaded.
4. Apply
3. Install Command Line Tools:
1. Tools -> SDK Manager -> SDK Tools Tab -> Android SDK Command Line Tools
(latest)
10.0
2. Apply
4. Install SDK 26:
1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 8.0 (Oreo) SDK Level
26
4. Install SDK 30:
1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 11.0 (R) SDK Level
30
2. Apply
5. Install Emulator:
1. Tools -> Device Manager -> Create device -> Pixel 5 -> Android S API 31
Expand Down Expand Up @@ -98,21 +98,21 @@ architecture:

### Gradle & JDK Version

All Android projects utilize Gradle version 7.3.3 and JDK version 17.0.
All Android projects utilize Gradle version 7.3.3 and JDK version 11.0.

For developer using openjdk-17-jdk in MacOS, the JAVA_HOME environment variable
can be configured as follows via `sdkman`:
For developer using java 11 in MacOS, the JAVA can be configured as follows via
`sdkman`:

```
sdk install java 17.0.4.1-tem
sdk install java 11.0.26-tem
```

For developer using openjdk-17-jdk in Linux, the JAVA_HOME environment variable
For developer using openjdk-11-jdk in Linux, the JAVA_HOME environment variable
can be configured as follows:

```
sudo apt-get install openjdk-17-jdk
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
sudo apt-get install openjdk-11-jdk
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
```

<a name="kotlin"></a>
Expand Down
2 changes: 2 additions & 0 deletions examples/java-matter-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ system. You can install it through the following command as root:
sudo apt install default-jdk
```

Note: Current matter controller java app example needs java 8+.

You also need to install kotlin compiler on your Ubuntu system:

kotlin compiler version 1.8.10 or above is needed to compile
Expand Down
2 changes: 1 addition & 1 deletion integrations/cloudbuild/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ steps:
- name: pwenv
path: /pwenv

- name: "ghcr.io/project-chip/chip-build-vscode:108"
- name: "ghcr.io/project-chip/chip-build-vscode:112"
id: Android
env:
- PW_ENVIRONMENT_ROOT=/pwenv
Expand Down
6 changes: 3 additions & 3 deletions scripts/build/builders/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def validate_build_environment(self):
os.environ["ANDROID_HOME"], "tools", "bin", "sdkmanager"
)

# New SDK manager at cmdline-tools/latest/bin/
# New SDK manager at cmdline-tools/10.0/bin/
new_sdk_manager = os.path.join(
os.environ["ANDROID_HOME"], "cmdline-tools", "latest", "bin", "sdkmanager"
os.environ["ANDROID_HOME"], "cmdline-tools", "10.0", "bin", "sdkmanager"
)
if not (
os.path.isfile(sdk_manager) and os.access(sdk_manager, os.X_OK)
Expand Down Expand Up @@ -413,7 +413,7 @@ def generate(self):
new_sdk_manager = os.path.join(
os.environ["ANDROID_HOME"],
"cmdline-tools",
"latest",
"10.0",
"bin",
"sdkmanager",
)
Expand Down
4 changes: 2 additions & 2 deletions src/app/server/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ android_library("java") {
javac_flags = [ "-Xlint:deprecation" ]

# TODO: add classpath support (we likely need to add something like
# ..../platforms/android-26/android.jar to access BLE items)
# ..../platforms/android-30/android.jar to access BLE items)
}

java_prebuilt("android") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
jar_path = "${android_sdk_root}/platforms/android-30/android.jar"
}
8 changes: 4 additions & 4 deletions src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ android_library("java") {
]

# TODO: add classpath support (we likely need to add something like
# ..../platforms/android-26/android.jar to access BLE items)
# ..../platforms/android-30/android.jar to access BLE items)
}

if (chip_link_tests) {
Expand Down Expand Up @@ -711,7 +711,7 @@ if (chip_link_tests) {
javac_flags = [ "-Xlint:deprecation" ]

# TODO: add classpath support (we likely need to add something like
# ..../platforms/android-26/android.jar to access BLE items)
# ..../platforms/android-30/android.jar to access BLE items)
}

android_library("tests") {
Expand Down Expand Up @@ -746,12 +746,12 @@ if (chip_link_tests) {
javac_flags = [ "-Xlint:deprecation" ]

# TODO: add classpath support (we likely need to add something like
# ..../platforms/android-26/android.jar to access BLE items)
# ..../platforms/android-30/android.jar to access BLE items)
}
}

if (!matter_enable_java_compilation) {
java_prebuilt("android") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
jar_path = "${android_sdk_root}/platforms/android-30/android.jar"
}
}
4 changes: 2 additions & 2 deletions src/messaging/tests/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ android_library("java") {
javac_flags = [ "-Xlint:deprecation" ]

# TODO: add classpath support (we likely need to add something like
# ..../platforms/android-26/android.jar to access BLE items)
# ..../platforms/android-30/android.jar to access BLE items)
}

if (!matter_enable_java_compilation) {
java_prebuilt("android") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
jar_path = "${android_sdk_root}/platforms/android-30/android.jar"
}
}
2 changes: 1 addition & 1 deletion src/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ android_library("java") {
}

java_prebuilt("android_sdk") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
jar_path = "${android_sdk_root}/platforms/android-30/android.jar"
}
Loading