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.

Execution failed for task ':app:packageRelease' at installRelease

See original GitHub issue

I’m using React Native. When I want to lunch my app on Android (real device or emulator), it work perfectly. But, when I want to creatte an aab file, I can’t lunch it.

Steps to reproduce :

  • cd android on the project.
  • ./gradlew clean and then ./gradlew bundleRelease to clean the project and create aab file.
  • app-release.aab is now in [your_project]/android/app/build/outputs/bundle/release
  • Then, ./gradle installRelease, or cd .. and react-native run-android --variant=release to lunch the aab on your device/emulator

When I do the last step, I got this error :

> Task :app:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > java.lang.OutOfMemoryError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

I looking for the solution but nothing work to solve Execution failed for task ':app:packageRelease' or A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable

I also try to use Android Studio (Clean Project or Invalidate Caches/Restart) but doesn’t work.

Those someone has a solution ? Thanks

Environment Information

react-native-cli: 2.0.1
react-native: 0.63.0
gradle: 6.5

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 182.55 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
Binaries:
    Node: 12.18.3 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.6 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
    iOS SDK:
        Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
        API Levels: 23, 25, 28, 29, 30
        Build Tools: 28.0.3, 29.0.3, 30.0.2
        System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
Languages:
    Java: 1.8.0_242-release - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
npmPackages:
    @react-native-community/cli: ^4.13.0 => 4.13.1 
    react: ^16.9.0 => 16.14.0 
    react-native: 0.63.0 => 0.63.0 
    react-native-macos: Not Found
npmGlobalPackages:
    *react-native*: Not Found

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

71reactions
panhabotcommented, May 6, 2021

I am having the exact same error output but it was at assembleRelease In gradle.properties I add: org.gradle.jvmargs=-Xmx4g It work for me.

6reactions
dulmandakhcommented, Jan 16, 2021

Please refer to about how you can increase memory limit for Gradle https://stackoverflow.com/questions/47454257/how-to-increase-maximum-heap-size-for-the-gradle-daemon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Execution failed for task ':app:installRelease' react-native
FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:installRelease'. com.android.builder.testing.api.
Read more >
task :app:packagedebug failed react native - You.com - You.com
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > com.android.ide.common.signing.KeytoolException: ...
Read more >
Execution failed for task ':app:bundleReleaseJsAndAssets'.
execution failed for task ':app:bundlereleasejsandassets'. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On August 29, ...
Read more >
solved :: Error:Execution failed for task ':app:packageRelease ...
solved ::java - Error:Execution failed for task ':app:packageRelease' in Android Studio can't generate signed APK from Android studio "Execution .
Read more >
app:mergeReleaseResources' building APK-React Native
Coding example for the question Error Execution failed for task ':app:mergeReleaseResources' building APK-React Native.
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 Reddit Thread

No results found

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