Android release build GC overhead limit exceeded after upgrade to 0.67.3
See original GitHub issueDescription
I have upgraded RN from 0.63.3 to 0.67.3, when I try to build debug on android it works fine, but when I try to build release with ./gradlew app:assembleRelease
fail with GC overhead limit exceeded
I did increase heap memory in gradle.properties
this way: org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
but doesn’t work.
I run ./gradlew app:assembleRelease --scan
and I found these errros:
Moreover when I try to bundle assets separately with this command npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
and build with ./gradlew app:bundleRelease -x bundleReleaseJsAndAssets
It build successfully but APK size is way beyond its normal size, normally APK size is 50MB and with this it’s 135MB.
Max Gradle workers | 8 workers | – | – | – Java runtime | AdoptOpenJDK OpenJDK Runtime Environment 1.8.0_292-b10 | Java VM | AdoptOpenJDK OpenJDK 64-Bit Server VM 25.292-b10 (mixed mode) | Max JVM memory heap size | 3.5 GiB
Version
0.67.3
Output of npx react-native info
System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Memory: 2.61 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.7.1 - /opt/homebrew/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.5.2 - /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 23, 28, 29, 30, 31 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- RN upgrade 0.63.3 to 0.67.3
- Build release with
./gradlew app:assembleRelease
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
I was able to build with Gradle 6.7 and Gradle plugin 4.1.0. Most likely it’s problem with the Gradle version.
This issue was closed because it has been stalled for 7 days with no activity.