React Native with IntelliJ - Only cli starts and not run-android - android

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.

Related

expo eject - android app not finding developer environment after

I have got my expo project and I ran 'expo eject' to run it in the react-native CLI. It works on the iOS with some adjusting (thanks to the guys on GitHub) however I can't seem to get my android to work. It's saying
'Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.'
I have tried building a new react-native app (without using expo) and it works no problem.
To me the ejected project is not linking to the environment somewhere. I have tried updating android studio, going through the environment setup and update gradle (that caused more issues haha)
Has anybody else come across this please?
I have worked out the solution around this. Run these next steps soon after you do 'expo eject' (As it suggests in the console after eject runs)
Next steps
› 💡 You may want to run npx #react-native-community/cli doctor to help install any tools that your app may need to run your native projects.
› 🔑 Download your Android keystore (if you're not sure if you need to, just run the command and see): expo fetch:android:keystoreNext steps

can't run react native project in simulator from command

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.

react native run-android live reload not working

When I use npx react-native run-android command to run my project on android the live reload feature doesn't work and I can't even bring up the developer menu using Command + M.
When I run the same project on iOS using npx react-native run-ios everything works fine. What am I doing wrong?
I'm using MacOS 10.15.5 and React native 0.62.2. Not using Expo.
Managed to fix this. There were two issues with my project. Firstly BuildConfig was being imported from react in my MainApplication.java file. According to this post: https://stackoverflow.com/a/43183752/9295598 it should come from my package. Once I resolved this I noticed that my package name didn't match my folder structure. Seem like I renamed my project in the past and didn't update the folder structure.
Once the folder structure was fixed and BuildConfig was imported from my project, the BuildConfig.DEBUG started working as intended which fixed the rest of the issues.

React Native fails to run when built from Android Studio: ( Module AppRegistry is not a registered callabble module (calling runApplication) )

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.

Setting up AndroidStudio for ReactNative on Windows

everybody,
Yesterday I Installed everything necessary to develop and run an Android app with React Native on Windows: I updated my node.js, installed python2, react-native-cli, Android Studio with AndroidSDK with all tools and all necesary package details how it is described in React Native documentation. Also I set up Environment variables and path for ANDROID_HOME. Wneh I create a new emulator and run it I received this messages in Android studio:
"Unable to run 'adb': null"
and
"'C:\Users\User5\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary"
When I create and run a new ReactNative app the building stucks on 97%. Attach imgs bellow.
When I create and run project on iOS there is no any problem.
I watched a lot of videos and tutorials and nothing seems wrong. But they all are with older version of Android Studio.
Does anybody know where could be the problem?
Thanks in advance.
My React Native very first Android Project stuck building on this stage:

Categories

Resources