Release Mode Bundle Error
Release Mode Bundle Error
js --
bundle-output android/app/src/main/assets/index.android.bundle
and then run
cd android
./gradlew assembleRelease
Adding the --assets-dest option to the command then gave a duplicate assets error
when building, so I skipped that and it works perfectly.
Also, I tried experimenting with the version of hermes-engine, but that had no
effect. This issue doesn't seem to be anything to do with Hermes.
@palkerecsenyi
Author
palkerecsenyi commented on Apr 6, 2020
Update
Commenting out these lines fixed it, and my app runs successfully (with Hermes
enabled):
if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'
} else {
implementation 'org.webkit:android-jsc:+'
}
@Ayyanchira
Ayyanchira commented on Apr 6, 2020
Beginner in React Native :-
For me, I am getting this error because it seems like the build script is looking
assets folder inside the Android project.
cd android
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk
cd ..
npx react-native start
and then launch the app on the phone/emulator. This seems to work fine and was
unaffected by the update to 0.62.x
@wilsolutions
wilsolutions commented on Apr 8, 2020 •
The ./gradlew assembleDebug is completely fine to me.
However the ./gradlew assembleRelease fails with error:
Thank you
Fonte: https://react-native.rocketseat.dev/erros/android/
@duncte123
duncte123 commented on May 28, 2020
Currently facing this issue on 0.62.2, the bundle created from gradlew
bundleRelease wants to connect to the metro server somehow
Yes I did, I compiled on java 11 for some reason. Switching to java 8 solved the
issue.
@lfalkner
lfalkner commented on Jun 24, 2020
Still seeing the issue and confirmed we're using Java 8 to compile
@Imperyall
Imperyall commented on Jul 8, 2020
@lfalkner Still seeing the issue and confirmed we're using Java 8 to compile
@Imperyall
Imperyall commented on Jul 8, 2020 •
@duncte123 Currently facing this issue on 0.62.2, the bundle created from gradlew
bundleRelease wants to connect to the metro server somehow
@jstheoriginal
jstheoriginal commented on Jul 9, 2020
@duncte123 Currently facing this issue on 0.62.2, the bundle created from gradlew
bundleRelease wants to connect to the metro server somehow
Which node version are you using when you put node -v in the command line in your
project directory?
@Imperyall
Imperyall commented on Jul 9, 2020
@ duncte123 В настоящее время сталкивается с этой проблемой на 0.62.2, пакет,
созданный из gradlew bundleReleaseхочет как-то подключиться к серверу метро
Какую версию узла вы используете, когда помещаете node -vв командную строку в
каталоге вашего проекта?
v13.11.0
@jstheoriginal
jstheoriginal commented on Jul 9, 2020
That’s the same issue I had. It doesn’t work.
If you change it to use 10.16.3, does it work? That was my issue and it resolved
once I used that older node version.
@Imperyall
Imperyall commented on Jul 9, 2020
Это та же проблема, что и у меня. Не работает
Если вы измените его на использование 10.16.3, это работает? Это была моя проблема,
и она разрешилась, когда я использовал ту старую версию узла.
@jstheoriginal
jstheoriginal commented on Jul 9, 2020
I did have one other thing that might be required as well. I set the metro preset
to exactly 0.58.
@lorenzoangelini
lorenzoangelini commented on Jul 9, 2020
I have a similar problem.
i'm upgrading from 61.5 to 63.00.
i changed com.android.tools.build:gradle:3.4.2 ->
com.android.tools.build:gradle:3.5.3
and https://services.gradle.org/distributions/gradle-5.5-all.zip ->
https://services.gradle.org/distributions/gradle-6.2-all.zip
When i launch ./gradlew bundleDevRelease i don't find into the app.bundle the
index.android.bundle.
If i discard the previous changes it works.
Do other people have the same mistake?
@Imperyall
Imperyall commented on Aug 12, 2020
After creating the next bundle, everything repeated
It's hard to test for this to fail when the bundleRelease cannot be installed for
testing, or is there a way to know it will fail before deploying?
package.json:
"react": "16.13.1",
"react-native": "^0.63.0"
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/datetimepicker": "^2.6.1",
"@react-native-community/google-signin": "^4.0.3", (recently added)
"react-native-calendars": "^1.403.0", (recently added)
"@react-native-community/hooks": "^2.6.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.5",
"@react-native-community/picker": "^1.6.6",
node v10.16.3
java version "1.8.0_261"
com.android.tools.build:gradle:3.5.3
Crashlytics Report
@uzairleo
uzairleo commented on Jan 18, 2021 •
Solving this headache after some workaround there in android/app/src/main
, I am getting this error because it seems like the build script is looking assets
folder inside the Android project.
@mouhsnimohamed
mouhsnimohamed commented on May 3, 2021
if you'r using proguard add an exception to android/app/proguard-rules.pro:
@ithustle
ithustle commented on May 4, 2021
I'm getting this issue on 0.64 RN. The app doesn't throw the red screen, just
closed the app. I double checked in logs on Android Studio and show that error
@enniel
enniel commented on May 24, 2021 •
OK I've found a workaround for now. This probably isn't a great solution since it
doesn't take into account build variants and whatnot but it works for a
basic :app:assembleRelease.
//Fix for bundle not getting included in APK or AAB with android gradle plugin 4+
//Seems like there's a task ordering issue and the assets get computed before the
bundle is copied
//This forces the copy task to run before merge resources
project.afterEvaluate {
tasks.findAll { task ->
task.name.startsWith('merge') && task.name.endsWith('Resources')
}.each { t -> t.dependsOn "copyReleaseBundledJs" }
}
This forces gradle to run the "copy the js bundle to assets" task before the "merge
assets into the apk" task. It seems that for whatever reason with gradle 4+ the
task ordering can be wrong and the bundle gets moved to intermediate dir after
gradle has already picked up all the assets so it never gets included in the APK.
Hopefully someone with more knowledge of gradle than I can chime in with a better
solution.
@ErAmanDhiman
ErAmanDhiman commented on Jun 9, 2021
@palkerecsenyi ,
Need to Change your Gradle Version in Main => Build.gradle
in Dependencies
=> classpath 'com.android.tools.build:gradle:4.0.2' <=
Working for Me Try This
I have solved this for RN 0.60.5 when change gradle 3.4.x to 4.1.x, this solved my
problem with downgrade to 4.0.2
@felipezf
felipezf commented on Feb 18
Any solution to work with the last Gradle version (7.1.1)?
Update
Downgrading Gradle did fix the error for me on RN 67.2. This change in file
android/build.gradle:
dependencies {
// classpath('com.android.tools.build:gradle:7.1.1')
classpath('com.android.tools.build:gradle:4.1.2')
Rubon72, ahmdmhd, and nidorx reacted with thumbs up emoji
@Rubon72
Rubon72 commented on Mar 5
same problem for com.android.tools.build:gradle:7.1.1.
"react-native": "0.67.3",
I tried to change
classpath('com.android.tools.build:gradle:7.1.x')
with
classpath('com.android.tools.build:gradle:7.0.3')
"react-native": "0.67.4"
cd android
./gradlew assembleRelease
Adding the --assets-dest option to the command then gave a duplicate assets error
when building, so I skipped that and it works perfectly.
Also, I tried experimenting with the version of hermes-engine, but that had no
effect. This issue doesn't seem to be anything to do with Hermes.
Work for me! But before i must Clean Project from Android Studio > Build.
After ./gradlew assembleRelease run ./gradlew bundleRelease
"react-native": "0.69.3"
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
@foxbit19
foxbit19 commented on Aug 9
Update
I solved this issue by doing this before each build:
cd android
./gradlew assembleRelease
Adding the --assets-dest option to the command then gave a duplicate assets error
when building, so I skipped that and it works perfectly.
Also, I tried experimenting with the version of hermes-engine, but that had no
effect. This issue doesn't seem to be anything to do with Hermes.
React native
0.69.3
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
android/build.gradle
dependencies {
classpath('com.android.tools.build:gradle:7.0.4')
}
This is the sequence of commands that I've used:
@zakharchenkoAndrii
zakharchenkoAndrii commented 29 days ago •
For me helped proper versioning according to RN changelog. to 0.69.4
in particular:
classpath('com.android.tools.build:gradle:7.1.1')
classpath("de.undercouch:gradle-download-task:5.0.1")
...
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
@ThiBsc ThiBsc mentioned this issue 9 days ago
immediate crash on launch ThiBsc/UnitsTool#5
Open
@koploop
koploop commented 7 days ago
For me this problem appear with React Native 0.68 and JDK 11
i hava checked the jsBundleDirRelease (in build.gradle) and the bundle exist,so
why ?
im a little confused and depressed when my last project solved many build problems
finaly published to store but when create a new project use npx react-native init
xx,new problem appear...
@abouquet
abouquet commented 5 days ago
Got it working by launching gradlew assemble twice.
40 participants
@airowe
@mikejurka
@wilsolutions
@evelant
@brownieboy
@abouquet
@code-by
@ithustle
@jstheoriginal
@mrbrentkelly
@samuthekid
@lucasbento
@mouhsnimohamed
@felipezf
@duncte123
@foxbit19
@koploop
@Stas-Buzunko
@jamesone
@hanifmhd