When running e2e tests with detox on android, I've found that I often encounter the following error:
Execution failed for task ':expo-application:packageDebugAndroidTest'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> java.lang.OutOfMemoryError (no error message)
This happens specifically after running
detox build -c android
(after first running
expo prebuild
on a managed project).
A workaround I've found involves tweaking the android memory settings in the project gradle file (android/gradle.properties). Changing the
org.gradle.jvmargs
property from
-Xmx2048m
to
-Xmx4096m
seems to do the trick.
However, the problem with tweaking
gradle.properties
directly is it'll get regenerated every time
expo prebuild --clean
is run. So, are there any plans to support making these types of tweaks via maybe a config plugin? I know
expo-build-properties
allows you to tweak some android build properties like
compileSdkVersion
and
minSdkVersion
, but it doesn't seem to support tweaking other properties like
org.gradle.jvmargs
.