React-native application not opening after yarn eject - javascript

I started my small React-Native Project, by using create-react-native-app "appName", so this file will gave some boilerplate, and i used this with expo, after i completed my small app, now i need native code, So i googled and i found to make this create-react-native-app into react-native init project style, we need to use yarn eject. So i did that, but after doing this i got addition two folders in my project called "android" and "ios" its fine, But if i run my project now from my terminal.
react-native run-android
The app doesnot load into my mobile device, nor showing any error.

Related

how to run cloned/github remote react native app, err msg no android

NOTES: Im new in react native and i see there are so many approaches and with this error i thought the developer who built this app build it differently from what i learn so i don't understand why he didn't put the android folder
so i just joined a project and im going to run the apps in my pc by cloning it from github but when i try to npx react-native run-android it failed to run and the log is like this
error Android project not found. Are you sure this is a React Native project?
If your Android files are located in a non-standard location (e.g. not inside 'android' folder),
consider setting project.android.sourceDir option to point to a new location.
info Run CLI with --verbose flag for more details.
the folder structure is like this
The files show that the project is created with Expo. Specifically, you have a managed expo project.
npx react-native run-android would compile an android app from source, with Expo's managed workflow that's not needed. You will need the Expo Go App.
Expo also comes with its own commands to start the bundler. Instead of running npx react-native ... make use of the expo-cli running: npx expo start
However, in the package.json there is very likely a script called start. In that case, it's easier for you to run npm start.
After running this command the expo console opens. Here you can press a to open the app using expo go (or instructions on how to do so).
Alternatively, you can run npx expo run:android to start the expo go app on android yourself.
you are using an expo, there is a folder named .expo-shared, after
npm install
Try to run
npm start
or
expo start
or
npx expo start
something like this will appear:
https://imgur.com/U9I7Gf4
after that go to the terminal, open the emulator in you computer and click on the terminal and press 'a',

React Native Windows App Loading Error (80072f78)

I'm new to react and react-native, and am attempting to run the react-native-windows template project but have encountered an issue.
Error
App loads in a blank window with error banner Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true
Image for reference
What I've Tried
I followed the instructions on the react-native-windows getting started docs
Namely:
npx react-native init <projectName> --template react-native#^0.63.2
cd projectName
npx react-native-windows-init --overwrite
npx react-native run-windows
The process will start another terminal window with the react logo. The application will build successfully, and will start in a new window. However, the original error is always present.
I've tried uninstalling and reinstalling all relevant programs. I've also tried building in both c# and c++, to no avail (adding the --language flag in the third step above).
Versions
react-native-windows: 0.63
react-native: 0.63.2
Windows SDK: 10.0.18362.0
node: 14.16.0
npm: 6.14.11
I couldn't find any issues like this online. If anyone has a suggestion, I would appreciate it. I'm more than happy to provide further info. Thanks!

How to build react-native app for iOS properly?

I developed a react native app (version 57.4) on windows for android and it works fine.
Now I'm trying to build for iOS with no luck (as I don't have any experience with Xcode).
What I tried so far:
I knew that it requires a Mac and Xcode so I downloaded a VM, install Xcode.
Git clone myApp
react-native run-ios
But I got a lot of errors and build failures so after some search, I make these more steps:
react-native link
link some fonts manually
add a pod file and pod install
make some Xcode changes which I can't remember
react-native run-ios
And it works :)
BUT I had an issue with axios so I tried to fix it but I ruined the app so I removed the folder and re-cloned it again.
This time, I can't build successfully again!! and if it builds it crashes instantly!
My Question is what the exact steps do I need to make to build successfully on Mac (especially steps for Xcode)? including how to link all native dependencies correctly? and Is the pod file is necessary?

How to run React native program

I am trying to create a simple react native program on android. I am using this link but how can I use simulator to run any program? I am using react-native run-android but how can I proceed further ?
The command react-native run-android does not install or launch any emulator by it's own.
To use an emulator you must first install one.
Examples are Android Studio and Genymotion.
React-native has it's own instructions on how to install and run react-native on a emulator. You can find it here: Link
Follow the instructions under "Building Projects with Native Code".

JS and React Native: node.js doesn't accept 'import' keyword

I'm a beginner in using JavaScript and the framework React Native.
I have the task to program a mobile web app with React Native with another student from my class. He started to build an app, which is build without any problems on his Android Emulator. He sent me his App and node.js (my editor is JetBrains WebStorm, my partner uses the same editor) does not recognize my import react.
But when I start the app in my command line with react-native run-android everything function and I can see the app, but my problem is
that I can't run it from my editor.
I have already install those in my command line:
C:\Users\Hang>npm install -g yarn
C:\Users\Hang>npm install -g react-native-cli
What did I forget to install ?
Here is a screenshot of the message that I get when I try to run the App:
You are using Node.js Run configuration to start your application, but Node.js doesn't support ES6 modules natively (thus the Syntax erroron import), and, of course, it doesn't support react-native cli options, so running node index.android.js as you do won't start your app in android emulator. You should have used React Native run configuration instead. Please see https://blog.jetbrains.com/webstorm/2016/12/developing-mobile-apps-with-react-native-in-webstorm/, Running and debugging the app section
You have to install the react Native CLI for your IDE (webstorm)
you will find It here

Categories

Resources