Skip to content

Commit a34427f

Browse files
committed
Android build fix
1 parent 99c56b6 commit a34427f

File tree

5 files changed

+30
-51
lines changed

5 files changed

+30
-51
lines changed

app/include/keyboard_view.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ struct KeyboardLocale {
3232
struct KeyboardState {
3333
bool keys[_VK_KEY_MAX];
3434
KeyboardState() = default;
35-
explicit KeyboardState(const bool keys[_VK_KEY_MAX]): keys(keys) {}
3635
};
3736

3837
class KeyboardView;
Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
1-
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
2-
def buildAsApplication = !buildAsLibrary
3-
if (buildAsApplication) {
4-
apply plugin: 'com.android.application'
5-
}
6-
else {
7-
apply plugin: 'com.android.library'
1+
plugins {
2+
id 'com.android.application'
83
}
94

5+
def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
6+
107
android {
11-
compileSdkVersion 31
8+
namespace = "com.borealis.demo"
9+
compileSdkVersion 35
1210
defaultConfig {
13-
if (buildAsApplication) {
14-
applicationId "com.borealis.demo"
15-
}
16-
minSdkVersion 16
17-
targetSdkVersion 31
11+
minSdkVersion 21
12+
targetSdkVersion 35
1813
versionCode 1
1914
versionName "1.0"
20-
// borealis need at least ndk r22 (r21 don't have std::filesystem support)
21-
// The newer NDK library will cause lower versions of Android failed to run.
22-
// r26: support api21 and later
23-
// r24/r25: support api19 and later
24-
// r22/23: support api16 and later
25-
ndkVersion "22.1.7171670"
2615
externalNativeBuild {
27-
cmake {
28-
arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
29-
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
30-
abiFilters 'arm64-v8a'
31-
version = '3.16.0+'
32-
}
16+
ndkBuild {
17+
arguments "APP_PLATFORM=android-21"
18+
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
19+
abiFilters 'arm64-v8a'
20+
}
21+
cmake {
22+
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_static"
23+
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
24+
abiFilters 'arm64-v8a'
25+
}
3326
}
3427
}
3528
buildTypes {
@@ -40,37 +33,23 @@ android {
4033
}
4134
applicationVariants.all { variant ->
4235
tasks["merge${variant.name.capitalize()}Assets"]
43-
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
36+
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
4437
}
4538
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
4639
sourceSets.main {
4740
jniLibs.srcDir 'libs'
4841
}
4942
externalNativeBuild {
50-
cmake {
51-
path 'jni/CMakeLists.txt'
52-
version = '3.16.0+'
53-
}
54-
}
55-
56-
}
57-
lintOptions {
58-
abortOnError false
59-
}
60-
61-
if (buildAsLibrary) {
62-
libraryVariants.all { variant ->
63-
variant.outputs.each { output ->
64-
def outputFile = output.outputFile
65-
if (outputFile != null && outputFile.name.endsWith(".aar")) {
66-
def fileName = "org.libsdl.app.aar";
67-
output.outputFile = new File(outputFile.parent, fileName);
68-
}
43+
cmake {
44+
path 'jni/CMakeLists.txt'
6945
}
7046
}
7147
}
48+
lint {
49+
abortOnError = false
50+
}
7251
}
7352

7453
dependencies {
7554
implementation fileTree(include: ['*.jar'], dir: 'libs')
76-
}
55+
}

app/platforms/android-project/app/jni/vcpkg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"libpng",
1414
"opus",
1515
"expat",
16+
"zstd",
1617
{
1718
"name": "mbedtls",
1819
"platform": "!android"

app/platforms/android-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.3'
9+
classpath 'com.android.tools.build:gradle:8.2.0'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Nov 11 18:20:34 PST 2021
1+
#Mon Mar 31 20:41:09 CEST 2025
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
43
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
65
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)