question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android release build GC overhead limit exceeded after upgrade to 0.67.3

See original GitHub issue

Description

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: image image image image

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

  1. RN upgrade 0.63.3 to 0.67.3
  2. Build release with ./gradlew app:assembleRelease

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
PrimulaXcommented, Mar 18, 2022

I was able to build with Gradle 6.7 and Gradle plugin 4.1.0. Most likely it’s problem with the Gradle version.

0reactions
github-actions[bot]commented, Oct 2, 2022

This issue was closed because it has been stalled for 7 days with no activity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio: GC overhead limit exceeded - Stack Overflow
Increasing the IDE memory help as long as there is available memory on device, and invalidate cache/restart takes too long. My workaround for...
Read more >
Android Studio Gradle plugin sync OutOfMemoryError
Android Studio Gradle plugin sync OutOfMemoryError/ GC Overhead Limit Exceeded macOS OSX. Specifically, it failed at kapt{BuildVariant}
Read more >
java.lang.OutOfMemoryError: GC Overhead Limit Exceeded
Simply put, the JVM takes care of freeing up memory when objects are no longer being used. This process is called Garbage Collection...
Read more >
How to Fix GC Overhead Limit Exceeded when Dexing - Metova
Open your app's build.gradle (not the one in the project root) and add: android {. //snip. //add this into your existing 'android' block....
Read more >
GC overhead limit exceeded on gradle :app ... - Issue Tracker
Having the same problem in all versions of Android Studio during transformClassesWithDexForDebug phase: "GC overhead limit exceeded". Changing the value of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found