-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assembleRelease generates a functional apk only if index.android.bundle is located in main/assets directory #30140
Comments
Same issue here, have you solved it? |
Same here, I started experiencing this problem after upgrading android gradle plugin to 4.1.2. It only happens when it's a clean build, after that it seems to be working again. According to the documentation:
But even if I set org.gradle.configureondemand=false, this problem persists. It would be a lifesaver if anyone could provide any insights. |
For anyone encountering the same problem, this issue has been fixed: #30177 |
Is this supposed to be fixed in React Native 0.64? I see that #30177 is merged and I believe I can see the fix in my local Steps to reproduce:
Here's my output from
|
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
I have been at this for hours now and not getting anywhere. when I do ./gradlew assembleRelease and install the apk in my device, it crushes on load with the error "run metro or make sure index.android.bundle is packaged".
During the build process, I can see the bundle in generated and intermedite directories but not sure if they have any effect. If I copy either of the bundle to my main/assets/ directory and run assembleRelease again, the apk works fine.
Sure, if i do react-native bundle command before hand, it will also work. But I am curios what is the point of the bundle files in the build directory if they don't get included in the apk?
Looking at react.gradle file, I did notice jsBundleDirRelease is not used and the bundles are hard coded to be generated in generated and intermediate directories.
Is there away to copy the bundle into the apk without running react-native apk first? There must be a reason the bundle files are created when assembleRelease is run.
React Native version:
System:
OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 1.85 GB / 15.52 GB
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 14.5.0 - ~/.nvm/versions/node/v14.5.0/bin/node
Yarn: 1.22.5 - /usr/bin/yarn
npm: 6.14.6 - ~/.nvm/versions/node/v14.5.0/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.8 - /usr/bin/javac
Python: 2.7.17 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: ^0.63.1 => 0.63.1
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
I expected assembleRelease to package the index.android.bundle it creates and package it in the apk
Snack, code example, screenshot, or link to a repository:
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
You may provide a screenshot of the application if you think it is relevant to your bug report.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
The text was updated successfully, but these errors were encountered: