Android: upgrade to SDK 31 and NDK 23

This commit is contained in:
MoNTE48 2021-09-14 17:43:44 +02:00
parent e5ee349643
commit 3e36fcbc4a
6 changed files with 24 additions and 13 deletions

View File

@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 30 compileSdkVersion 31
buildToolsVersion '30.0.3' buildToolsVersion '31.0.0'
ndkVersion '22.1.7171670' ndkVersion '23.0.7599858'
defaultConfig { defaultConfig {
applicationId 'com.multicraft.game' applicationId 'com.multicraft.game'
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 30 targetSdkVersion 31
versionCode 170 versionCode 170
versionName "1.16.0" versionName "1.16.0"
} }

View File

@ -50,6 +50,7 @@
<activity <activity
android:name="com.multicraft.game.MainActivity" android:name="com.multicraft.game.MainActivity"
android:configChanges="orientation|keyboardHidden|navigation|screenSize" android:configChanges="orientation|keyboardHidden|navigation|screenSize"
android:exported="true"
android:maxAspectRatio="3.0" android:maxAspectRatio="3.0"
android:screenOrientation="sensorLandscape" android:screenOrientation="sensorLandscape"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
@ -62,6 +63,7 @@
<activity <activity
android:name="com.multicraft.game.GameActivity" android:name="com.multicraft.game.GameActivity"
android:configChanges="orientation|keyboard|keyboardHidden|navigation|screenSize|smallestScreenSize" android:configChanges="orientation|keyboard|keyboardHidden|navigation|screenSize|smallestScreenSize"
android:exported="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:maxAspectRatio="3.0" android:maxAspectRatio="3.0"

View File

@ -1,6 +1,6 @@
#Sat Jul 10 17:16:36 EEST 2021 #Mon Sep 13 14:41:51 CEST 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'de.undercouch.download' apply plugin: 'de.undercouch.download'
android { android {
compileSdkVersion 30 compileSdkVersion 31
buildToolsVersion '30.0.3' buildToolsVersion '31.0.0'
ndkVersion '22.1.7171670' ndkVersion '23.0.7599858'
defaultConfig { defaultConfig {
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 30 targetSdkVersion 31
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors(), arguments '-j' + Runtime.getRuntime().availableProcessors(),

View File

@ -103,7 +103,11 @@ local function init_globals()
-- Create main tabview -- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0}) local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
tv_main:add(tabs.local_game) local default_game = core.settings:get("default_game")
if gamemgr.find_by_gameid(default_game) then
tv_main:add(tabs.local_game)
end
tv_main:add(tabs.play_online) tv_main:add(tabs.play_online)
for _, page in pairs(htabs) do for _, page in pairs(htabs) do

View File

@ -304,8 +304,13 @@ void notifyServerConnect(bool is_multiplayer)
void notifyExitGame() void notifyExitGame()
{ {
jmethodID notifyExit = jnienv->GetMethodID(nativeActivity, jmethodID notifyExit;
"notifyExitGame", "()V"); try {
notifyExit = jnienv->GetMethodID(nativeActivity,
"notifyExitGame", "()V");
} catch (...) {
return;
}
FATAL_ERROR_IF(notifyExit == nullptr, FATAL_ERROR_IF(notifyExit == nullptr,
"porting::notifyExit unable to find java notifyExitGame method"); "porting::notifyExit unable to find java notifyExitGame method");