Skip to content

Commit 47f86a5

Browse files
feat: optimize Gradle memory usage and reduce APK size by excluding unnecessary files
1 parent e89f6bd commit 47f86a5

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

android/app/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,30 @@ android {
8787
targetSdkVersion rootProject.ext.targetSdkVersion
8888
versionCode 22
8989
versionName "1.3.3"
90+
91+
// Increase memory allocated to Gradle
92+
dexOptions {
93+
javaMaxHeapSize "4g"
94+
}
95+
}
96+
97+
// Add large heap support to the application
98+
aaptOptions {
99+
cruncherEnabled = false
90100
}
101+
102+
packagingOptions {
103+
// Exclude unnecessary files to reduce APK size
104+
exclude 'META-INF/DEPENDENCIES'
105+
exclude 'META-INF/LICENSE'
106+
exclude 'META-INF/LICENSE.txt'
107+
exclude 'META-INF/license.txt'
108+
exclude 'META-INF/NOTICE'
109+
exclude 'META-INF/NOTICE.txt'
110+
exclude 'META-INF/notice.txt'
111+
exclude 'META-INF/ASL2.0'
112+
}
113+
91114
signingConfigs {
92115
debug {
93116
storeFile file('debug.keystore')

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
android:allowBackup="false"
1212
android:theme="@style/AppTheme"
1313
android:supportsRtl="true"
14-
android:gwpAsanMode="always">
14+
android:gwpAsanMode="always"
15+
android:largeHeap="true">
1516
<activity
1617
android:name=".MainActivity"
1718
android:label="@string/app_name"

0 commit comments

Comments
 (0)