React-native: android release hangs forever at app:transformClassesAndResourcesWithR8ForRelease

Created on 25 Aug 2019  路  9Comments  路  Source: facebook/react-native

after upgrading my react-native app to version 0.60.5, the application works just fine in debugging mode but when i try to get the android release files of my app by running this command:

react-native run-android --variant=release

the progress gets stuck at this line:

> :app:transformClassesAndResourcesWithR8ForRelease

and hangs on forever

React Native version:
0.60.5

Steps To Reproduce

1.upgrade to react-native version 0.60.5
2.run 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
3.then run react-native run-android --variant=release

Describe what you expected to happen:
i would like to extract release files (apks) of my application.

note: i tried to delete the build and gradle folders and run ./gradlew clean but didn't work either

Bug Android

Most helpful comment

Hi.

Try adding more memory to gradle:
edit gradle.properties file and add

org.gradle.jvmargs=-Xmx4096m

All 9 comments

I got the same issue. Any possible solutions?

Hi.

Try adding more memory to gradle:
edit gradle.properties file and add

org.gradle.jvmargs=-Xmx4096m

I get a different problem. Running in Emulator is fine but as soon as I generate an APK and try to run the app on a real device then the initial load hangs forever.

This behavior has made it practically impossible to troubleshoot where my problem is coming from.

@FrenchMajesty - did you ever resolve this?

anyone with a solution? really getting messy 馃槩

facing same issue
RN: 62.2
React: 16.11.0

iOS builds fine
Android: debug version runs fine on Emulator / Device

Configured the signing configs and stuff for Android
The release build starts and hangs at this, like forever, without any error

Hi.

Try adding more memory to gradle:
edit gradle.properties file and add

org.gradle.jvmargs=-Xmx4096m

I tried this
It works pretty fine.

i solved the problem by leaving react native and using another framework in that project, thanks guys.

Hi.

Edit gradle.properties file and add
org.gradle.jvmargs=-Xmx4096m
then try this commande

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
After

cd android

gradlew clean

last

gradlew bundleRelease -x bundleReleaseJsAndAssets

i hope it helps :)

Was this page helpful?
0 / 5 - 0 ratings