When I run react-native run-android --variant=Release or any other variant I defined in build.gradle I got stuck on Building 91% > :app:bundleReleaseJsAndAssets. If I run just debug it works fine. It happens as well when running ./gradlew assambleRelease.
When I manually run Build apk from Android Studio, then it successfully creates the apks.
EDIT: When I run apk generated from Android Studio, the app crashes on run. I expect this is due AppRegistry.registerComponent fails when you usually run the app trough studio not trough react-native cli
Usually it takes time in first round. Just try again and in my case it took around 10 mins to build the release.
Related
I have a problem several days ago, I work in ubuntu and I would appreciate it very much if you help me :( I have a personal project that is finished and I want to get the apk, when I create the apk with ionic cap build I don't get any error, just a warn of Plugins are missing dependencies which I don't think is a problem, worse when I run ionic cap run and select the device either external or emulator I get Running Gradle build - failed! and at the end An error occurred while running thread capacitor. ionic cap build warning ionic cap run ERROR Also when I create the apk android studio opens automatically and I get this message: Error: Android Studio
WARNING
ERROR BUILD
Error Android Studio
I already tried deleting the node_modules folder, installing android studio, node, java,
gradle although I don't know if it installed correctly, etc.
1st image: You're missing the es6-promise-plugin. you need to install it
2nd and 3rd image: you are using an old version of gradle, which it is making it incompatible with what the compiler uses (8+). You need to install new version of gradle.
I am new in RN, and frankly in any modern front-end tools. So, I am working on an existing project, where I just run
npx react-native start
to run the project from the terminal, when the packager has started, I run
npx react-native run-ios
on another terminal window, which pretty reluctantly starts the ios simulator and opens the app as well. but the problem occurs when I run
npx react-native run-android
on the same windows, it gives throws an error as given in the screenshot:
To solve the problem, I always open my Android Studio, and build and run the app, which runs the app in the android simulator.
But I would really appreciate if there are some JavaScript or RN geeks who can help me run the app in android by the command
npx react-native run-android
I run a mac, use VS Code, I have yarn, npm installed.
Just try to remove the virtual device from avd manager in android studio and recreate it again. I also faced this issue recently and this is how i solved it. Also, check for any available update in android studio build tools.
I am experiencing a strange situation with my React Native project and Android Studio.
BUILDING DEBUG
Using the react-native command line tools, I can build and run my Android app without any problem. (using react-native run-android)
However when I try and build my debug app from Android studio, i get the following error on launch - Module AppRegistry is not a registered callabble module (calling runApplication)
BUT, if I do react-native run-android first, which installs the build and launches the javascript loader terminal, and then after that I continue triggering builds from Android Studio all is well.
So it appears that using Android Studio to build and install a fresh version of the app doesn't work anymore (i have a feeling that the fact that it doesn't launch the javascript package loader terminal is a clue).
BUILDING 'RELEASE'
Similar problems when I try and build the release version.
I can use react-native run-android --variant=release to build and install the APK to a device, with no problem.
If I try and build the release from Android Studio, however, I get a new error on compile which is -
`Execution failed for task ‘:app:bundleReleaseJsAndAssets’
> A problem occurred starting process ‘command ‘node’’`
So it appears that something is wrong with my Android Studio, seeing that I can do everything I need to via react-native command line, but Im not sure what it could be..? I have a feeling that both the debug and release build problems are related, and I feel like its got to do with how Android Studio is triggering the javascript/node stuff. But unsure how to fix, or make sure.
I've created a new React Native app with react-native init ProjectName and tried to run it within IntelliJ. For this I've created a new run configuration:
But after run this configuration, only react-native start is executed and not the actual start of the app (react-native run-android). Within a shell it's working, but not with IntelliJ and therefore debugging within IntelliJ is not readily possible.
I'm using the latest React Native version 0.50.1 and IntelliJ 2017.2.5.
Do you know such a problem and do you know how to fix it? For existing applications, it still worked, but not for new ones. After npm install it seems to be buggy also with existing projects.
Known issue, tracked as WEB-29569: the packager messages format has changed in react-native 0.50.*, and WebStorm can't parse the output and start the run command.
As a workaround, you can try downgrading react-native to 0.49.
When I run app on device with react-native run-android everything is fine.
Once I run app with react-native run-android --configuration Release and it was also fine.
But now when I run this same command I can't see changes in my app it's still the same previous version.
I can't find any command that I can use to somehow clean previous release build for new one.
Can somebody help me with this?