facebook/react-native

0.76.1 Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'. > Java heap space

ayanWappnet opened this issue · 4 comments

Description

i create new project with 0.76.1 and install library package and i migrate my old project to new 0.76.1

Steps to reproduce

  1. install yarn which version 1.22.22
  2. react native 0.76.1
  3. clean build with => cd android && ./gradlew clean && cd ..
  4. and run project

React Native Version

0.76.1

Affected Platforms

Runtime - Android, Build - Linux

Output of npx react-native info

System:
  OS: Linux 5.8 Ubuntu 20.04.6 LTS (Focal Fossa)
  CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
  Memory: 5.17 GB / 15.57 GB
  Shell:
    version: 5.0.17
    path: /bin/bash
Binaries:
  Node:
    version: 21.7.3
    path: ~/.nvm/versions/node/v21.7.3/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/bin/yarn
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v21.7.3/bin/npm
  Watchman:
    version: 4.9.0
    path: /usr/bin/watchman
SDKs:
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0
    wanted: 15.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Failed to transform react-android-0.76.1-debug.aar (com.facebook.react:react-android:0.76.1) to match attributes {artifactType=android-databinding, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for JetifyTransform:

.gradle/caches/modules-2/files-2.1/com.facebook.react/react-android/0.76.1/100f1d6599f807cbf57a4c51764b302eb2bd8b71/react-android-0.76.1-debug.aar.
         > Java heap space

* 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.

BUILD FAILED in 12s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'. > Failed to transform react-android-0.76.1-debug.aar (com.facebook.react:react-android:0.76.1) to match attributes {artifactType=android-databinding, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}. > Execution failed for JetifyTransform: 

.gradle/caches/modules-2/files-2.1/com.facebook.react/react-android/0.76.1/100f1d6599f807cbf57a4c51764b302eb2bd8b71/react-android-0.76.1-debug.aar. > Java heap space * 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. BUILD FAILED in 12s.

Reproducer

<>

Screenshots and Videos

No response

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

Please provide a valid reproducer. You can use this template.

Hey @shubhamguptadream11

some times i found this error
Error: ENOENT: no such file or directory, lstat 'NativeSampleTurboModule'
ules/@react-native/codegen/lib/cli/combine/combine-js-to-schema-cli.js:26:10)
at Module._compile (node:internal/modules/cjs/loader:1368:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
at Module.load (node:internal/modules/cjs/loader:1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
at node:internal/main/run_main_module:28:49 {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: 'NativeSampleTurboModule'

build.gradle

buildscript {
ext {
buildToolsVersion = "35.0.0"
firebaseMessagingVersion = "21.1.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
playServicesLocationVersion = "21.0.1"
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "com.google.gms:google-services:4.3.14"
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath ("com.google.firebase:firebase-crashlytics-gradle:2.9.9")
}
}

apply plugin: "com.facebook.react.rootproject"

app/build.gradle

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.google.gms.google-services"
apply plugin: "com.facebook.react"
apply plugin: "com.google.firebase.crashlytics"
project.ext.envConfigFiles = [
development: ".env.development",
test: ".env.test",
staging: ".env.staging",
release: ".env.production",
]
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation platform('com.google.firebase:firebase-bom:33.5.1')
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics")
implementation project(':react-native-html-to-pdf')
implementation 'com.facebook.fresco:animated-gif:3.4.0' // Add this line for GIF support
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.android.gms:play-services-location:21.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation('org.apache.httpcomponents:httpmime:4.3.6') { exclude module: 'httpclient' }
implementation ('org.bouncycastle:bcprov-jdk15on:1.65') { exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on' }
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation (project(':react-native-camera'))
{
exclude group: "com.google.android.gms"
}

if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}

}