mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 21:48:19 +00:00
Upgrade Gradle and fix Android deprecation errors
Upgrade to Gradle 8.5 and Gradle Plugin 8.3.0 for compatibility with Java 21. Explicity set Java version 21 in `build.gradle`. Increment compile and target SDK version to 34 accordingly. Remove the explicitly defined, obsolete `buildToolsVersion` property in `build.gradle`, as it is now automatically derived by Gradle. Replace the deprecated property `android:extractNativeLibs` in `AndroidMainfest.xml` with `useLegacyPackaging` in `build.gradle`. Replace the deprecated package definition `package="tw.DDNet"` in `AndroidMainfest.xml` with `namespace("tw.DDNet")` in `build.gradle`. Add the required property `android:exported="true"` to the main activity in `AndroidMainfest.xml`.
This commit is contained in:
parent
cdbe1f775a
commit
664b0e98bb
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="tw.DDNet">
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:glEsVersion="0x00030000" />
|
android:glEsVersion="0x00030000" />
|
||||||
<uses-feature
|
<uses-feature
|
||||||
|
@ -21,7 +20,6 @@
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:hasCode="true"
|
android:hasCode="true"
|
||||||
android:extractNativeLibs="true"
|
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:isGame="true"
|
android:isGame="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
@ -29,16 +27,16 @@
|
||||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||||
<activity
|
<activity
|
||||||
android:name=".NativeMain"
|
android:name=".NativeMain"
|
||||||
|
android:exported="true"
|
||||||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
|
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
|
||||||
android:screenOrientation="landscape">
|
android:screenOrientation="landscape">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="android.app.lib_name"
|
<meta-data
|
||||||
|
android:name="android.app.lib_name"
|
||||||
android:value="DDNet" />
|
android:value="DDNet" />
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -10,19 +10,25 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
classpath 'com.android.tools.build:gradle:8.3.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdkVersion 34
|
||||||
buildToolsVersion "30.0.3"
|
|
||||||
ndkVersion "TW_NDK_VERSION"
|
ndkVersion "TW_NDK_VERSION"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "tw.DDNet"
|
applicationId "tw.DDNet"
|
||||||
|
namespace("tw.DDNet")
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 30
|
targetSdkVersion 34
|
||||||
versionCode TW_VERSION_CODE
|
versionCode TW_VERSION_CODE
|
||||||
versionName "TW_VERSION_NAME"
|
versionName "TW_VERSION_NAME"
|
||||||
}
|
}
|
||||||
|
@ -46,7 +52,11 @@ android {
|
||||||
shrinkResources false
|
shrinkResources false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
packagingOptions {
|
||||||
|
jniLibs {
|
||||||
|
useLegacyPackaging = true
|
||||||
|
}
|
||||||
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
Loading…
Reference in a new issue