Skip to content

Commit 04f03b3

Browse files
Update Android build setup (#1228)
* Update fmd and spdlog third party modules to a recent combination that compiles on Android Should also fix #912 * Update validation layers for Android builds to 1.3.296 * Updated Android build files to work latest Android tooling * Replace ALooper_pollAll with ALooper_pollOnce Use of ALooper_pollAll has been deprecated on current Android versions * Remove package from Android manifest This has been deprecated with recent Android version Package name now comes from gradle setup * Update Android build instructions * Update gradle to 8.9 * Change gradle distribution url * Fix VVL download script Had a wrong "release only"dependency * adb spelling It's lower case on all platforms, upper case only works properly on windows * Trying to fix those annoying quality checks * Update Java version for Android CI builds * Android JDK setup * Revert adb name change * bump versions for Android and fix a few things. * Github CI has NDK 27 installed but not yet 28. It doesn't make a difference to Vulkan Samples, so downgrading for CI purposes is a good idea. * Update the JDK that github is using. * Update wording on required Android Studio version. --------- Co-authored-by: swinston <[email protected]>
1 parent 3792764 commit 04f03b3

File tree

14 files changed

+90
-66
lines changed

14 files changed

+90
-66
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ jobs:
146146
with:
147147
submodules: "recursive"
148148

149-
- name: set up JDK 11
150-
uses: actions/setup-java@v3
149+
- name: set up JDK
150+
uses: actions/setup-java@v4
151151
with:
152-
java-version: "11"
153-
distribution: "temurin"
152+
java-version: "21"
153+
distribution: "zulu"
154154
cache: gradle
155155
- name: ccache
156156
uses: hendrikmuhs/[email protected]

app/android/AndroidManifest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
- Copyright (c) 2019-2023, Arm Limited and Contributors
3+
- Copyright (c) 2019-2024, Arm Limited and Contributors
44
-
55
- SPDX-License-Identifier: Apache-2.0
66
-
@@ -19,12 +19,10 @@
1919
-->
2020
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2121
xmlns:tools="http://schemas.android.com/tools"
22-
package="com.khronos.vulkan_samples"
2322
android:versionCode="1"
2423
android:versionName="1.0">
2524

2625
<application android:label="@string/app_name"
27-
android:allowBackup="false"
2826
android:debuggable="true"
2927
android:icon="@mipmap/ic_launcher"
3028
android:roundIcon="@mipmap/ic_launcher_round"

bldsys/cmake/android_sync_folder.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[[
2-
Copyright (c) 2019-2023, Arm Limited and Contributors
2+
Copyright (c) 2019-2024, Arm Limited and Contributors
33
44
SPDX-License-Identifier: Apache-2.0
55

bldsys/cmake/template/gradle/app.build.gradle.in

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ plugins {
22
id 'com.android.application'
33
}
44

5-
ext.vvl_version='1.3.275.0'
5+
ext.vvl_version='1.3.296.0'
66
apply from: "./download_vvl.gradle"
77

88
android {
9-
compileSdk 33
10-
buildToolsVersion "33.0.0"
11-
ndkVersion "25.2.9519653"
9+
ndkVersion '27.2.12479018'
10+
compileSdk 35
1211

1312
defaultConfig {
14-
applicationId "com.khronos.vulkan_samples"
13+
applicationId 'com.khronos.vulkan_samples'
14+
namespace "com.khronos.vulkan_samples"
1515
@MIN_SDK_VERSION@
16-
targetSdk 33
16+
targetSdk 35
1717
versionCode 1
1818
versionName "1.0"
1919

@@ -43,8 +43,8 @@ android {
4343
}
4444

4545
compileOptions {
46-
sourceCompatibility JavaVersion.VERSION_1_8
47-
targetCompatibility JavaVersion.VERSION_1_8
46+
sourceCompatibility JavaVersion.VERSION_21
47+
targetCompatibility JavaVersion.VERSION_21
4848
}
4949

5050
sourceSets {
@@ -64,21 +64,21 @@ android {
6464
}
6565
}
6666

67-
lintOptions {
68-
checkReleaseBuilds false
67+
lint {
6968
abortOnError false
69+
checkReleaseBuilds false
7070
}
71-
71+
7272
buildFeatures {
7373
viewBinding true
7474
prefab true
7575
}
7676
}
7777

7878
dependencies {
79-
implementation 'androidx.appcompat:appcompat:1.6.1'
80-
implementation 'com.google.android.material:material:1.8.0'
81-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
82-
implementation 'androidx.core:core:1.9.0'
83-
implementation 'androidx.games:games-activity:2.0.0'
79+
implementation 'androidx.appcompat:appcompat:1.7.0'
80+
implementation 'com.google.android.material:material:1.12.0'
81+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
82+
implementation 'androidx.core:core:1.15.0'
83+
implementation 'androidx.games:games-activity:3.0.5'
8484
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id 'com.android.application' version '7.4.2' apply false
3-
id 'com.android.library' version '7.4.2' apply false
2+
id 'com.android.application' version '8.7.2' apply false
3+
id 'com.android.library' version '8.7.2' apply false
44
}
55

6-
task clean(type: Delete) {
7-
delete rootProject.buildDir
6+
tasks.register('clean', Delete) {
7+
delete rootProject.layout.buildDirectory
88
}

bldsys/cmake/template/gradle/download_vvl.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ apply plugin: 'com.android.application'
3636
*/
3737

3838
// get the validation layer version.
39-
def VVL_VER = "1.3.275.0"
39+
def VVL_VER = "1.3.296.0"
4040
if (ext.has("vvl_version")) {
4141
VVL_VER = ext.vvl_version
4242
}
@@ -76,5 +76,6 @@ dependencies {
7676
}
7777

7878
project.afterEvaluate{
79+
project.getTasks().getByName("mergeDebugJniLibFolders").dependsOn(unzip)
7980
project.getTasks().getByName("mergeReleaseJniLibFolders").dependsOn(unzip)
8081
}
-15.9 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

bldsys/cmake/template/gradle/gradlew

Lines changed: 31 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bldsys/cmake/template/gradle/gradlew.bat

Lines changed: 21 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)