- Notifications
You must be signed in to change notification settings - Fork24.9k
Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0+/gradle 6.5#30177
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
analysis-bot commentedOct 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Base commit:fb14fd4 |
analysis-bot commentedOct 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Base commit:fb14fd4 |
emeraldsanto commentedOct 14, 2020
I've also been experiencing this since updating this morning, reverting to 4.0.1 and 6.3 works until this PR is merged :) |
Ensure mergeResources task runs after currentAssetsCopyTask
c752304 toa6c7049CompareJust rebased so that the commit message is more descriptive |
I have the reproducible case and fixed case with this patch https://github.com/tomoima525/android_build_test_rn Reproducible caseTo reproduce the issue, run the command below app-release.apk will be generated but it does not have index.android.bundle build Fixed caseI added the fix in#30177 . Running the command below will apply the patch to (The script is tested on Mac. If the copying does not work on Linux, try directly copying the |
mikehardy commentedOct 21, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Confirmed for me this fixes the error it says it fixes for RN0.63.3 and android gradle plugin 4.1.0 Here's a patch-package compatible thing you can cut-and-paste cat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for your contribution! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@cpojer has imported this pull request. If you are a Facebook employee, you can view this diffon Phabricator.
This pull request was successfully merged by@tomoima525 in53f5500. |
… plugin 4.1.0+/gradle 6.5 (#30177)Summary:- This fixresolves#29398- After updating gradle to 6.5+ and android gradle plugin to 4.1.0+(which is recommended in the latest Android Studio 4.1), Running `:app:assembleRelease` or `:app:bundleRelease` will not contain `index.android.bundle` in Apk/AAB. It will be included when the command executed twice.<img width="949" alt="Screen Shot 2020-10-17 at 11 32 43 PM" src="https://user-images.githubusercontent.com/6277118/96360808-38165c00-10d5-11eb-8b6e-f098517a24c7.png">- This is caused by the task ordering update introduced in gradle plugin 4.1.0+/gradle 6.5. `mergeResources` task runs before `currentAssetsCopyTask`(copying the bundle asset file to intermediate output directory) which causes generated Apk/AAB not including the bundle file.- The fix ensures mergeResources task runs after currentAssetsCopyTask## Changelog[Android] [Fixed] - Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5Pull Requestresolved:#30177Test Plan:- Reproducible repositoryhttps://github.com/tomoima525/android_build_test_rn - This project is generated with `create-react-native-app` and updated Gradle version to 6.5 and com.android.tools.build:gradle plugin to 4.1- Run `./gradlew clean :app:assembleRelease` and `./gradlew clean :app:bundleRelease` => reproduces the issue- After adding the fix above and run `./gradlew clean :app:assembleRelease` and `./gradlew clean :app:bundleRelease` => The issue is resolved- Also confirmed the build works properly with android gradle plugin `3.5.3` and `gradle 6.2`(the default value of `create-react-native-app`)Reviewed By: fkgozaliDifferential Revision: D24551605Pulled By: cpojerfbshipit-source-id: b0effe2c6ea682748af185061af951e2f2bce722
John-Konordo commentedDec 12, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Development machine OS: MacOS X I had also aply the patch from here#29398 (comment) I found a workarround to publish my apk to play console and don' t get the error index.android.bundle missing In root directory of your project run the following commands Install my apk to any device and works well and upload the apk to play console and the error dissapear too! |
… plugin 4.1.0+/gradle 6.5 (facebook#30177)Summary:- This fixresolvesfacebook#29398- After updating gradle to 6.5+ and android gradle plugin to 4.1.0+(which is recommended in the latest Android Studio 4.1), Running `:app:assembleRelease` or `:app:bundleRelease` will not contain `index.android.bundle` in Apk/AAB. It will be included when the command executed twice.<img width="949" alt="Screen Shot 2020-10-17 at 11 32 43 PM" src="https://user-images.githubusercontent.com/6277118/96360808-38165c00-10d5-11eb-8b6e-f098517a24c7.png">- This is caused by the task ordering update introduced in gradle plugin 4.1.0+/gradle 6.5. `mergeResources` task runs before `currentAssetsCopyTask`(copying the bundle asset file to intermediate output directory) which causes generated Apk/AAB not including the bundle file.- The fix ensures mergeResources task runs after currentAssetsCopyTask## Changelog[Android] [Fixed] - Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5Pull Requestresolved:facebook#30177Test Plan:- Reproducible repositoryhttps://github.com/tomoima525/android_build_test_rn - This project is generated with `create-react-native-app` and updated Gradle version to 6.5 and com.android.tools.build:gradle plugin to 4.1- Run `./gradlew clean :app:assembleRelease` and `./gradlew clean :app:bundleRelease` => reproduces the issue- After adding the fix above and run `./gradlew clean :app:assembleRelease` and `./gradlew clean :app:bundleRelease` => The issue is resolved- Also confirmed the build works properly with android gradle plugin `3.5.3` and `gradle 6.2`(the default value of `create-react-native-app`)Reviewed By: fkgozaliDifferential Revision: D24551605Pulled By: cpojerfbshipit-source-id: b0effe2c6ea682748af185061af951e2f2bce722
pixelknitter commentedApr 21, 2021
@mikehardy For those discovering this solution, I thought I'd figure out exact instructions to patch from 0.63.3 as my project is not ready to migrate to 0.64; this seems like a good option. I've not used |
@pixelknitter - nope, If you are making anew patch (like how I generated this file) to fix some bug where you are the first person to find+fix, then you hack around in node_modules by hand yes, and run |
pixelknitter commentedApr 21, 2021
Thanks for the detailed response! |
mouhsnimohamed commentedMay 3, 2021
if you'r using proguard add an exception to android/app/proguard-rules.pro: -keep class com.mypackage.BuildConfig { *; } com.mypackage should match the package value in your app/src/main/AndroidManifest.xml file. |
xczaixian commentedMay 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
thank you, but it's not work for me. |
@xczaixian this is no longer a problem with current versions (0.64.1) - I'm not carrying this patch any longer as it has been integrated and released. Better to update and get the real fix |
9christian9 commentedFeb 9, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ciao, Affected Versions
The common error
In short, index.android.bundle is missing. The problem The solution I hope this will help. |
Uh oh!
There was an error while loading.Please reload this page.
Summary
:app:assembleReleaseor:app:bundleReleasewill not containindex.android.bundlein Apk/AAB. It will be included when the command executed twice.mergeResourcestask runs beforecurrentAssetsCopyTask(copying the bundle asset file to intermediate output directory) which causes generated Apk/AAB not including the bundle file.Changelog
[Android] [Fixed] - Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5
Test Plan
Reproducible repositoryhttps://github.com/tomoima525/android_build_test_rn
create-react-native-appand updated Gradle version to 6.5 and com.android.tools.build:gradle plugin to 4.1Run
./gradlew clean :app:assembleReleaseand./gradlew clean :app:bundleRelease=> reproduces the issueAfter adding the fix above and run
./gradlew clean :app:assembleReleaseand./gradlew clean :app:bundleRelease=> The issue is resolvedAlso confirmed the build works properly with android gradle plugin
3.5.3andgradle 6.2(the default value ofcreate-react-native-app)