Skip to content

Commit 1feb90a

Browse files
Update Android SDK version to 36 (#191)
Fixed Proguard rules for Gson Co-authored-by: Simon Zhong <[email protected]>
1 parent 77b1722 commit 1feb90a

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

app/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ target_link_libraries(native-sample ${LOG_LIB})
88
# include paths generated by androidNativeBundle
99
include (${ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK})
1010
# change native-sample to your native lib's name
11-
target_link_libraries(native-sample ${ANDROID_GRADLE_NATIVE_MODULES})
11+
target_link_libraries(native-sample ${ANDROID_GRADLE_NATIVE_MODULES})
12+
13+
# Android 15: Support 16KB page sizes
14+
# see https://developer.android.com/guide/practices/page-sizes
15+
target_link_options(native-sample PRIVATE "-Wl,-z,max-page-size=16384")

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
//}
1717

1818
android {
19-
compileSdkVersion 34
19+
compileSdkVersion 36
2020
namespace "com.example.vu.android"
2121

2222
compileOptions {
@@ -27,7 +27,7 @@ android {
2727
defaultConfig {
2828
applicationId "com.example.vu.android"
2929
minSdkVersion 21
30-
targetSdkVersion 34
30+
targetSdkVersion 36
3131
versionCode System.getenv('VERSION_CODE')?.toInteger() ?: 241226
3232
versionName System.getenv('VERSION_NAME') ?: "24.12.26"
3333

app/proguard-rules.pro

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,19 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22+
23+
# Gson uses generic type information stored in a class file when working with
24+
# fields. Proguard removes such information by default, keep it.
25+
-keepattributes Signature
26+
27+
# This is also needed for R8 in compat mode since multiple
28+
# optimizations will remove the generic signature such as class
29+
# merging and argument removal. See:
30+
# https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson
31+
-keep class com.google.gson.reflect.TypeToken { *; }
32+
-keep class * extends com.google.gson.reflect.TypeToken
33+
34+
# Optional. For using GSON @Expose annotation
35+
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
36+
-keep class com.google.gson.reflect.TypeToken { <fields>; }
37+
-keepclassmembers class **$TypeAdapterFactory { <fields>; }

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
dependencies {
1313
classpath 'com.android.tools.build:gradle:8.6.0'
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
classpath "io.github.howardpang:androidNativeBundle:1.1.4"
15+
classpath "io.github.howardpang:androidNativeBundle:1.1.5"
1616
classpath 'com.fullstory:gradle-plugin-local:1.12.1'
1717
classpath 'com.mxalbert.gradle:jacoco-android:0.2.1'
1818
}

0 commit comments

Comments
 (0)