Skip to content

Commit

Permalink
Update compile SDK version and NDK version.
Browse files Browse the repository at this point in the history
* Target API level 34.

* Update NDK to r25b. This will be the last NDK update to LOVE 11.x as future NDK dropped support for Android KitKat and earlier.
  • Loading branch information
MikuAuahDark committed Sep 26, 2023
1 parent af732a0 commit d257a3b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Detailed instructions can be viewed at https://github.com/love2d/love-android/wi
Quick Start:
------------

Before you start, install JDK 17 or later. If you intend to build from Android Studio, skip this step as
Before you start, install JDK 17 (not later not earlier). If you intend to build from Android Studio, skip this step as
Android Studio bundles its own JDK 17.

Install Android SDK with SDK API 33 (33.0.0) and Android NDK 23.2.8568313, set the environment variable
Install Android SDK with SDK API 34 (34.x.y) and Android NDK 25.2.9519653, set the environment variable
`ANDROID_SDK_ROOT` to your Android SDK location and run:

```
Expand All @@ -63,8 +63,8 @@ run either `gradlew assembleEmbedNoRecordRelease` (or `gradlew assembleEmbedReco
generate APK which you can install or `gradlew bundleEmbedNoRecordRelease` (or `gradlew bundleEmbedRecordRelease`) to generate
AAB which you can upload to Play Store.

Alternatively, you can install Android Studio **2022.2.1** or later. After opening it for the first time, open its SDK Manager
and on the tab "SDK Tools", tick "Show Package Details" then select NDK (Side By Side) version 23.2.8568313. After that, open
Alternatively, you can install Android Studio **2022.3.1** or later. After opening it for the first time, open its SDK Manager
and on the tab "SDK Tools", tick "Show Package Details" then select NDK (Side By Side) version 25.2.9519653. After that, open
the repository root.

Notice: Previously, the embed + APKTool method is preferred, but recent announcements by Google render that method obsolete.
Expand All @@ -81,6 +81,12 @@ Note: If in doubt, fill an issue report to https://github.com/love2d/love/issues
Changelog:
----------

11.5:

* Contains all relevant changes for desktop LÖVE [11.5](https://love2d.org/wiki/11.5).
* Fixed audio in Android still playing in the background in certain cases. ([love2d/love#1828](https://github.com/love2d/love/issues/1828))


11.4:

* Contains all relevant changes for desktop LÖVE [11.4](https://love2d.org/wiki/11.4).
Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ apply plugin: 'com.android.application'

android {
namespace "org.love2d.android.executable"
compileSdk 33
buildToolsVersion '33.0.0'
ndkVersion '23.2.8568313'
ndkVersion '25.2.9519653'

defaultConfig {
applicationId project.properties["app.application_id"]
versionCode project.properties["app.version_code"].toInteger()
versionName project.properties["app.version_name"]
minSdkVersion 16
targetSdk 33
minSdk 16
compileSdk 34
targetSdk 34

def getAppName = {
def nameArray = project.properties["app.name_byte_array"]
Expand Down Expand Up @@ -44,7 +44,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions 'mode', 'recording'
flavorDimensions = ['mode', 'recording']
productFlavors {
normal {
dimension 'mode'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.android.tools.build:gradle:8.1.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
25 changes: 15 additions & 10 deletions love/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ android {
// See https://code.google.com/p/android/issues/detail?id=52962
// and http://stackoverflow.com/questions/27277433/why-does-gradle-build-my-module-in-release-mode-when-the-app-is-in-debug
// defaultPublishConfig "debug"
compileSdkVersion 33
buildToolsVersion '33.0.0'
ndkVersion '23.2.8568313'
namespace "org.love2d.android"
ndkVersion '25.2.9519653'

defaultConfig {
compileSdkVersion 33
buildToolsVersion '33.0.0'
minSdkVersion 16
minSdk 16
compileSdk 34
targetSdk 34
externalNativeBuild {
ndkBuild {
arguments "-j" + Runtime.runtime.availableProcessors()
Expand All @@ -23,10 +21,10 @@ android {
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
// noinspection ChromeOsAbiSupport
abiFilters 'armeabi-v7a', 'arm64-v8a'
debugSymbolLevel 'SYMBOL_TABLE'
}
targetSdkVersion 33
}

def retrieveAll3pModules = { ->
Expand All @@ -35,14 +33,15 @@ android {
fileTree("src/jni/lua-modules").visit { FileVisitDetails details ->
if (details.isDirectory()) {
if (file(details.file.path + "/Android.mk").exists()) {
def logger = project.getLogger()
logger.lifecycle("3rd-party module: " + details.file.path)

def javainfo = file(details.file.path + "/java.txt")
if (javainfo.exists()) {
def fstream = new FileInputStream(javainfo)
def infile = new BufferedReader(new InputStreamReader(fstream))
def javapath = infile.readLine().replace("\\", "/")
def mpath = null
def mpath = ""

if (javapath[0] != '/') {
mpath = details.file.path + "/" + javapath
Expand All @@ -69,11 +68,12 @@ android {
}
debug {
ndk {
// noinspection ChromeOsAbiSupport
abiFilters += 'x86_64'
}
}
}
flavorDimensions 'mode'
flavorDimensions = ['mode']
productFlavors {
normal {
dimension 'mode'
Expand Down Expand Up @@ -103,7 +103,12 @@ android {
}
packagingOptions {
jniLibs {
excludes += ['lib/arm64-v8a/libSDL2.so', 'lib/armeabi-v7a/libSDL2.so']
excludes += [
'lib/arm64-v8a/libSDL2.so',
'lib/armeabi-v7a/libSDL2.so',
'lib/x86_64/libSDL2.so',
'lib/x86/libSDL2.so'
]
}
}
lint {
Expand Down

0 comments on commit d257a3b

Please sign in to comment.