Updated Gradle and AGP to 8

This commit is contained in:
Anuken 2024-07-06 14:57:49 -04:00
parent 62df1e321d
commit aa645fe67c
5 changed files with 15 additions and 8 deletions

View File

@ -7,7 +7,7 @@ buildscript{
}
dependencies{
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:8.5.0'
}
}
@ -29,8 +29,9 @@ task deploy(type: Copy){
}
android{
buildToolsVersion '33.0.2'
compileSdkVersion 33
namespace = "io.anuke.mindustry"
buildToolsVersion = '34.0.0'
compileSdk = 34
sourceSets{
main{
manifest.srcFile 'AndroidManifest.xml'
@ -56,7 +57,7 @@ android{
applicationId "io.anuke.mindustry"
minSdkVersion 14
targetSdkVersion 33
targetSdkVersion 34
versionName versionNameResult
versionCode = vcode
@ -65,6 +66,8 @@ android{
props['androidBuildCode'] = (vcode + 1).toString()
}
props.store(file('../core/assets/version.properties').newWriter(), null)
multiDexEnabled true
}
compileOptions{
@ -72,7 +75,7 @@ android{
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "google"
flavorDimensions = ["google"]
signingConfigs{
release{

View File

@ -1,11 +1,12 @@
-dontobfuscate
#these are essential packages that should not be "optimized" in any way
#the main purpose of d8 here is to shrink the absurdly-large google play games libraries
-keep class mindustry.** { *; }
-keep class arc.** { *; }
-keep class net.jpountz.** { *; }
-keep class rhino.** { *; }
-keep class com.android.dex.** { *; }
-keepattributes Signature,*Annotation*,InnerClasses,EnclosingMethod
-dontwarn javax.naming.**
#-printusage out.txt

View File

@ -72,6 +72,8 @@ public class AndroidLauncher extends AndroidApplication{
@Override
public ClassLoader loadJar(Fi jar, ClassLoader parent) throws Exception{
//Required to load jar files in Android 14: https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading
jar.file().setReadOnly();
return new DexClassLoader(jar.file().getPath(), getFilesDir().getPath(), null, parent){
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException{

View File

@ -25,4 +25,5 @@ org.gradle.caching=true
#used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false
archash=b857594d11

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists