-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Release APK fails immediately on launch (Version 0.54) #18357
Comments
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release? Thank you for your contributions. |
How did you pack the release version of App? |
Im using Android Studio to generate the release version of the app. Its taking me through the same steps that I have using for Java-based Android apps without problems. |
Have the same issue. I'm using Build -> Generate signing APK in android studio. |
I just updated to 0.54 which actually took me to 0.54.2 and I have the same result. my new react-native info dump: Environment: Packages: (wanted => installed) |
Well. It's working with |
Thanks that definitely worked. I did not use the --variant=release, but the command-line process works fine. It may be gradle, but it appears that Android Studio is using the same commands. Thanks for your help @alexmbp |
This issue is still present! However the fix is setting android.enableAapt2=false and the using "Generate signed APK" command. If react-native is boasting of supporting both frameworks then they should take care of announcing these issue fixes too. |
Wow. I’ll |
Sorry. Hit the wrong button. I’m reopening this until it’s fixed. |
Please note! RN 0.54.0 - 0.54.2 has issue with fetch call. It returns Blob, instead of returning the InitBody as string. I suggest you downgrade your RN to any version between 0.51 to 0.53 |
@deepeshkarkee do you know if RN 0.55 RC has fixed the fetch issues? |
@doertli: I haven't tried RN0.55 RC. |
Experiencing the same issue with RN 0.55.3 |
I'm using version
Another option is generating signed apks using command line as suggested by @alexmbp. This procedure is described here. |
Add this lines
before |
I am having the same issue. Works fine in debug but once I release the APK it crashes on load. Here are my packages.
I see info on downgrading react-native but nothing has worked for me. My app is in production and need help asap. Any ideas? |
|
Thank you very man it helps me lot, its save my day |
The fix is upgrading RN to 0.57.4 or downgrading gradle to 3.1.4. For those who want a really neat workaround without having to upgrade/downgrade:
|
I’m having the same problem but my react native and gradle versions seem newer. My environment: android/ build.gradle
} |
Root cause well explained here --> #18357 (comment), thanks @jsaraiva
Thanks everyone for your help, it was painful to face this issue. |
Still having this issue with |
This is still an issue apparently. Which is amazing. |
I've been using RN 0.57.4 and gradle 3.2+ up to this point without any issues. I recently added Here is some more information on how to repro:
Build on a device for release using one of the flavors: With |
i have same trouble. |
@mpalmerlee Yes I'm using productFlavors. |
Any update on this issue ? |
hello, it is not working for me , help plz |
Facing same issue. Using latest RN 59 and gradle 3.4, works in debug mode but on --variant=release it just crashes. |
does anybody has any solution on this please... we all are having same issue i followed all the steps but build still fails and i get same error "Task 'installRelease' not found in project ':app'. Some candidates are: 'uninstallRelease'" FAILURE: Build failed with an exception.
BUILD FAILED in 1m 41s |
@gauravsbagul I have faced this before the fix was to setup signingConfigs for your buildType
|
Downgrading to 3.1.4 for gradle fixed the problem for me.. finally.. lost a lot of hair on this. As @mpalmerlee mentioned, upgrading to newer versions of react native didn't resolve this if you're using productFlavors. In my case, I was using RN 0.57.4 |
I had same problem with android 3.4.0 and gradle 5.4.1, I downgrade to android 3.3 and gradle 4.10.1 and the issue is gone. I use React Native 0.59.5. |
I can confirm versions that @Bvida100 stated. For beginners or confused how to downgrade you can do that in following config files:
and
Best to do that from Android Studio by opening android solution. It should prompt to sync gradle, do that and sync should be successful. |
@remarcus looks like the best answer to me. |
…ebook#21409) Summary: Android Gradle Plugin 3.2 uses a new intermediates/merged_assets directory instead of intermediates/assets. This workaround copies the javascript bundle to both directories for compatibility purposes. Fixes facebook#21132 Fixes facebook#18357 Pull Request resolved: facebook#21409 Differential Revision: D10141860 Pulled By: hramos fbshipit-source-id: 0fb20fcec67ec2bfd7a8d9052599bbc70464b466
I have tried upgrading to versions suggested by @remarcus and @thib92 and am still finding the app crash on launch (for release versions only). |
@taeminpak I believe there were a lot of changes since 0.57.4 and even some breaking ones with the releases of 0.58 and 0.59. If possible you could try RN v0.59.9, because it has support for more recent build tools. If not I would suggest retrieving logs from device running release version of your app and the issue might not be connected to this one. Regarding AndroidX recent release of Google Play Services has impacted some libraries that were using its latest version (i.e. react-native-device-info), but that's unlikely because it would probably crash on build first. I also had some issues in the past regarding drawables and not having asset of required density so app would crash. Would suggest you to create a new fresh project and add your current dependencies to see if problem is actually in current build tools and RN version. You could also take a look at RN Changelog to see if something has been fixed with newer versions. It's always like playing cat and mouse unfortunately. Good luck! :) |
@remarcus |
Please check your render() function and see if your are using any Component which been deprecated checking by commenting each one of them one by one .Hope it might help |
…ebook#21409) Summary: Android Gradle Plugin 3.2 uses a new intermediates/merged_assets directory instead of intermediates/assets. This workaround copies the javascript bundle to both directories for compatibility purposes. Fixes facebook#21132 Fixes facebook#18357 Pull Request resolved: facebook#21409 Differential Revision: D10141860 Pulled By: hramos fbshipit-source-id: 0fb20fcec67ec2bfd7a8d9052599bbc70464b466
I have a web view app that is very straightforward. The iOS version is running perfectly. The android version runs perfectly in debug mode using the package server. However, the release version of the apk crashes immediately when launched.
The errors I am getting from logcat are:
since this does not use the package server, I figured the problem is that the bundle is packaged incorrectly. However, I am not sure that I can do to fix the way the package is bundled.
I did some searches and noticed that this problem is caused the View.propTypes references. I followed the steps to see if there were any such references in my modules and there are not. There are only comments referring to the issue and explaining the patches put into place.
I also found an article that suggested I check the name of the app in the index.js file and compare that with the name in the MainActivity. I checked those and they are identical. I also checked my package.json for the same name.
I have also done several cleans of the project using Gradle.
Thanks for any help that can be provided.
Environment
Expected Behavior
I expected the app to launch and show the website in the webView.
I am unable to reproduce the error in snack, but here is the link that shows how it should work: https://snack.expo.io/r1JzDYSFG
Actual Behavior
dialog box shows up saying "app has stopped" and ask to open again.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: