Skip to content
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

Fix bug that index.android.bundle is missing when building a release AAB #30824

Conversation

thanakij
Copy link

@thanakij thanakij commented Feb 1, 2021

Summary

The official solution in this pull only solves some part of the issue #29398.

Next, I would like to see my additional step I suggested here get merged so I create this pull request :).

Changelog

[Android] [Fixed] - Fix missing index.android.bundle when building release AAB with gradle plugin 4.1

Test Plan

Already confirmed by many people in the thread.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 1, 2021
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 505f9fc

@lorenzoangelini
Copy link

@thanakij is it works also with proguard enabled? Because i have the same issue only with the proguard enabled.

@thanakij
Copy link
Author

@thanakij is it works also with proguard enabled? Because i have the same issue only with the proguard enabled.

Yes, I have proguard enabled in my setting for my release build.

@lorenzoangelini
Copy link

@thanakij Perfect!

@kofsiwon
Copy link

kofsiwon commented May 7, 2021

I'am not using Proguard, but APK was crashed.
So, I had to generate APK many times when every release.
Sometimes APK file size is weird and App was crashed with Error 'Metro Server is not running, can not find index.android.bundle'

@thanakij
Copy link
Author

thanakij commented May 7, 2021

Hi @lorenzoangelini, any news on this? :)

@thanakij
Copy link
Author

thanakij commented May 7, 2021

I'am not using Proguard, but APK was crashed.
So, I had to generate APK many times when every release.
Sometimes APK file size is weird and App was crashed with Error 'Metro Server is not running, can not find index.android.bundle'

Hi, can you try my patch to see if it works for you by either manually editing node_modules/react-native/react.gradle or using patch-package?

@kofsiwon
Copy link

kofsiwon commented May 7, 2021

I'am not using Proguard, but APK was crashed.
So, I had to generate APK many times when every release.
Sometimes APK file size is weird and App was crashed with Error 'Metro Server is not running, can not find index.android.bundle'

Hi, can you try my patch to see if it works for you by either manually editing node_modules/react-native/react.gradle or using patch-package?

ok, I'm trying to generate apk few times. with dependsOn(currentBundleTask).
I will let you know the test result.

how can I use patch-package? I don't know about it.

@kofsiwon
Copy link

kofsiwon commented May 7, 2021

Test with with dependsOn(currentBundleTask).

[Generate APK 5 Times]
app-release1.apk - 142.2MB
app-release2.apk - 142.2MB
app-release3.apk - 142.2MB
app-release4.apk - 142.2MB
app-release5.apk - 142.2MB
[Clean and Generate APK 5 Times]
app-release6.apk - 140.8MB
app-release7.apk - 140.8MB
app-release8.apk - 140.8MB
app-release9.apk - 140.8MB
app-release10.apk - 140.8MB
[Generate APK 5 Times]
app-release11.apk - 142.2MB
app-release12.apk - 142.2MB
app-release13.apk - 142.2MB
app-release14.apk - 142.2MB
app-release15.apk - 142.2MB

First APK after clean is weird.
"react-native": "0.63.3",

@thanakij
Copy link
Author

thanakij commented May 7, 2021

Because my patch builds on top of this pull, I just need your help to check if you have those changes as well.

@julianD77
Copy link

Looks like this PR has now been included in v66.0 onwards with this PR: #32026

@thanakij thanakij closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants