Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Android CI

on:
push:
branches: [ "margarita" ]
pull_request:
branches: [ "margarita" ]



jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug #build
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: '**/*.apk'

16 changes: 12 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ android {

versionCode appVersionCode
versionName appVersionName


//noinspection MinSdkTooLow
minSdkVersion appAndroidMinSDK
targetSdkVersion appAndroidTargetSDK
multiDexEnabled true
resourceConfigurations += ['en_US', 'cs', 'de', 'el', 'es', 'fr', 'hu', 'in', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'tr', 'uk', 'vi', 'zh_CN']

}
Expand All @@ -37,9 +39,9 @@ android {
//This makes release APKs smaller and more efficient, but also makes debugging trickier
//as the information produced in stack traces must be de-obfuscated.
//See here: https://developer.android.com/studio/build/shrink-code#decode-stack-trace
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// shrinkResources true
// minifyEnabled true
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

dependencies {
releaseImplementation project(':services:updates:githubUpdates')
Expand All @@ -54,7 +56,9 @@ android {
}
}
}

dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}
configurations { natives }

dependencies {
Expand Down Expand Up @@ -125,3 +129,7 @@ task copyAndroidNatives() {
// jvmTarget = "1.8"
// }
//}
dependencies {
def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"
}
3 changes: 2 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
android:resizeableActivity="true"
android:allowBackup="true"
android:fullBackupOnly="true"
android:backupAgent=".AndroidBackupHandler">
android:backupAgent=".AndroidBackupHandler"
android:name="androidx.multidex.MultiDexApplication" >
<activity
android:name=".AndroidLauncher"
android:screenOrientation="nosensor"
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'

}
}

Expand All @@ -22,6 +23,7 @@ allprojects {
appAndroidCompileSDK = 33
appAndroidMinSDK = 19
appAndroidTargetSDK = 33


gdxVersion = '1.11.0'
gdxControllersVersion = '2.2.4-SNAPSHOT'
Expand All @@ -35,4 +37,7 @@ allprojects {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

}
}
/*dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}*/
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemor
org.gradle.parallel=true

# Necessary to turn off certain R8 optimizations that would otherwise cause Shattered to crash
android.enableR8.fullMode=false
android.enableR8.fullMode=false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comment above. are you sure it's not a problem?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, you can ignore this commit. I personally prefer to disable minify and obfuscation of build files during compilation, so that game applications will be more friendly for developers to debug.

android.useAndroidX=true