Skip to content

Commit

Permalink
Upgrade to Android API level 32, upgraded tools and upgraded ndk
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed Aug 11, 2022
1 parent 0e6f765 commit 796716c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ commands:
name: Install missing Android SDK & NDK
command: |
sdkmanager \
"build-tools;28.0.3" \
"ndk;21.3.6528147"
"build-tools;33.0.0" \
"ndk;25.0.8775105"
android-setup:
steps:
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:

Lint Android with ktlint and detekt:
docker:
- image: cimg/android:2022.03.1
- image: cimg/android:2022.07.1
steps:
- checkout
- android-setup
Expand All @@ -409,7 +409,7 @@ jobs:

Android tests:
docker:
- image: cimg/android:2022.03.1
- image: cimg/android:2022.07.1
steps:
- checkout
- skip-if-doc-only
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Kotlin
* BUGFIX: Re-enable correctly connecting `glean.validation.foreground_count` again ([#2153](https://github.com/mozilla/glean/pull/2153))
* BUGFIX: Gradle plugin: Correctly remove the version conflict check. Now the consuming module need to ensure it uses a single version across all dependencies ([#2155](https://github.com/mozilla/glean/pull/2155))
* Upgrade dependencies and increase to Android target/compile SDK version 32 ([#2150](https://github.com/mozilla/glean/pull/2150))

# v51.1.0 (2022-08-08)

Expand Down
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ buildscript {
ext.versions = [
android_gradle_plugin: '7.2.1',
android_maven_publish_plugin: '3.6.2',
coroutines: '1.5.0',
coroutines: '1.6.1',
jna: '5.8.0',
junit: '4.12',
mockito: '3.11.2', // This is different than a-c, but we're fine, it's only tests.
mockito: '3.11.2',
mockwebserver: '4.9.1', // This is different than a-c, but we're fine, it's only tests.
kotlin: '1.5.20',
robolectric: '4.7.3', // This is different than a-c, but we're fine, it's only tests.
kotlin: '1.6.10',
robolectric: '4.8.1',
rust_android_plugin: '0.9.1',

// Android X dependencies
androidx_annotation: '1.1.0',
androidx_appcompat: '1.2.0',
androidx_browser: '1.2.0',
androidx_appcompat: '1.3.0',
androidx_browser: '1.3.0',
androidx_core: '1.3.0',
androidx_espresso: '3.3.0',
androidx_junit: '1.1.2',
androidx_junit: '1.1.3',
androidx_lifecycle_extensions: '2.2.0',
androidx_test: '1.3.0',
androidx_work: '2.4.0',
androidx_test: '1.4.0',
androidx_work: '2.7.1',
androidx_uiautomator: '2.2.0',
]

ext.build = [
ndkVersion: "21.3.6528147", // Keep it in sync in TC Dockerfile.
compileSdkVersion: 29,
targetSdkVersion: 28,
ndkVersion: "25.0.8775105", // Keep it in sync in TC Dockerfile.
compileSdkVersion: 32,
targetSdkVersion: 32,
minSdkVersion: 21, // So that we can publish for aarch64.
]

Expand Down
26 changes: 13 additions & 13 deletions docs/dev/android/sdk-ndk-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

The Glean SDK implementation is currently build against the following versions:

* SDK API 28
* Look for `android-28` in the SDK manager
* or install with: `sdkmanager --verbose "platforms;android-28"`
* Android build tools 28.0.3
* Download link: <https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip>
* NDK r21
* Download link: <https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip>
* SDK API 32
* Look for `android-32` in the SDK manager
* or install with: `sdkmanager --verbose "platforms;android-32"`
* Android Command line tools
* Download link: <https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip>
* NDK r25
* Download link: <https://dl.google.com/android/repository/android-ndk-r25-linux-x86_64.zip>

For the full setup see [Setup the Android Build Environment](setup-android-build-environment.html).

Expand All @@ -20,10 +20,10 @@ All locations need to be updated on upgrades:
* `dev/android/setup-android-build-environment.md`
* CI configuration
* `.circleci/config.yml`
* `sdkmanager 'build-tools;28.0.3'`
* `image: circleci/android:api-28-ndk`
* `sdkmanager 'build-tools;33.0.0'`
* `image: circleci/android:2022.07.1`
* `taskcluster/docker/linux/Dockerfile`.
* `ENV ANDROID_BUILD_TOOLS "28.0.3"`
* `ENV ANDROID_SDK_VERSION "3859397"`
* `ENV ANDROID_PLATFORM_VERSION "28"`
* `ENV ANDROID_NDK_VERSION "r21"`
* `ENV ANDROID_BUILD_TOOLS "33.0.0"`
* `ENV ANDROID_SDK_VERSION "8512546"`
* `ENV ANDROID_PLATFORM_VERSION "32"`
* `ENV ANDROID_NDK_VERSION "25.0.8775105"`
6 changes: 3 additions & 3 deletions docs/dev/android/setup-android-build-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If Android Studio asks you to upgrade the version of Gradle, decline.
The following dependencies can be installed in Android Studio through `Tools > SDK Manager > SDK Tools`:

- Android SDK Tools (may already be selected)
- NDK r21
- NDK r25
- CMake
- LLDB

Expand All @@ -46,10 +46,10 @@ sdk.dir=/path/to/sdk
For the Android NDK:

1. Download NDK r21 from <https://developer.android.com/ndk/downloads>.
2. Extract it and put it somewhere (`$HOME/.android-ndk-r21` is a reasonable choice, but it doesn't matter).
2. Extract it and put it somewhere (`$HOME/.android-ndk-r25` is a reasonable choice, but it doesn't matter).
3. Add the following line to the `local.properties` file in the root of the Glean checkout (create the file if it does not exist):
```
ndk.dir=/path/to/.android-ndk-r21
ndk.dir=/path/to/.android-ndk-r25
```

### Setting up Rust
Expand Down
6 changes: 4 additions & 2 deletions samples/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

<!-- Note: the usesCleartextTraffic is only required for making instrumentation
tests work on API 23+. Also note that this requires tools:ignore="UnusedAttribute"
Expand All @@ -25,7 +26,8 @@
android:name=".GleanApplication">
<activity android:name="org.mozilla.samples.gleancore.MainActivity"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
2 changes: 1 addition & 1 deletion samples/android/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
android:layout_marginTop="10dp"
android:text="@string/glean_enabled_info" />

<Switch
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/uploadSwitch"
android:checked="true"
android:layout_width="match_parent"
Expand Down
8 changes: 4 additions & 4 deletions taskcluster/docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ WORKDIR /builds/worker/

# Configuration

ENV ANDROID_BUILD_TOOLS "30.0.3"
ENV ANDROID_TOOLS_VERSION "7583922"
ENV ANDROID_PLATFORM_VERSION "30"
ENV ANDROID_NDK_VERSION "21.3.6528147"
ENV ANDROID_BUILD_TOOLS "33.0.0"
ENV ANDROID_TOOLS_VERSION "8512546"
ENV ANDROID_PLATFORM_VERSION "32"
ENV ANDROID_NDK_VERSION "25.0.8775105"

# Set up the language variables to avoid problems (we run locale-gen later).
ENV LANG en_US.UTF-8
Expand Down

0 comments on commit 796716c

Please sign in to comment.