Ubuntu, one of the most popular Linux distribution is on its another LTS (Long Term Support) version named Bionic Beaver. All you need to do is simply run the two commands we.React Native framework is getting more attention from developers who want to build cross-platform mobile applications (Android/ios). Npx react-native init ReactNativeAppOnce you have an emulator up and running, proceed to the next step. Now, let's run the React Native CLI via NPM's built-in 'npx' command. Creating a new React Native project We're finally ready to spin up a new React Native project Open your Terminal back up and change directories to your code folder where you keep your projects.Quick step: set terminal to use Rosetta set XCode to use Rosetta small adjust on podFile if you have problem with react native flipper.We can start working with a React Native project with two methods. I already resume and create guide article on how to run react native iOS Macbook with M1 Chip. But, Now i can compile and build react native run-ios sucessfully.
Emulator React Native Project Code Folder WhereWhen you create a project, you must specify the OS the app is to be run on so that the right boilerplate code can be generated. Another difference is that you have to choose which type of OS you want to develop in when using Xamarin. This is a react-native wrapper around Twilio Programmable Voice SDK.With React Native, you can use your preferred text editor. Caesar 3 for macInstallation stepsSo let’s start the steps to install React Native on our Ubuntu system. This is the reason behind the making of this tutorial. But I faced some issues when following it and some of the steps are a little bit confusing. It requires Android studio to be installed on our system.We can find an installation tutorial on the official React Native page. If we are already familiar with mobile development, you may want to use React Native CLI.Here we are setting up a React Native project with React Native CLI. Create a New React Native Project (2:47) Configure the iOS Simulator for React Native Development Mac Only (2:24) Configure the Android Emulator for React Native Development (2:22)If we are new to mobile development, the easiest way to get started is with Expo CLI. So Java Development Kit(JDK) is required to work with React Native projects. Install JDKNative Android apps are build using Java. However, we can install the latest version for NPM using the command below. Install NPMNPM will be installed with the Nodejs installation itself. Curl -sL | sudo -E bash -Sudo apt-get install -y nodejs 2. Install Android SDKAndroid Studio installs the latest Android SDK by default. We can easily download it from the official website that I have given below. Install Android StudioAndroid studio needs to be installed for working with React Native development. Sudo add-apt-repository ppa:openjdk-r/ppaSudo apt-get install openjdk-8-jdk 4. Google APIs Intel x86 Atom_64 System ImageConfigure ANDROID_HOME environment variableThe React Native tools require some environment variables to be set up in order to build apps with native code.First copy the lines, export ANDROID_HOME=$HOME/Android/SdkExport PATH=$PATH:$ANDROID_HOME/platform-toolsNow create a file. Look for and expand the Android 11.0 (R) entry, and make sure the following items are all checked: Click on Configure, then select SDK Manager.Then check the box next to “Show Package Details” in the bottom right corner. Additional Android SDKs can be installed through the SDK Manager in Android Studio.The SDK Manager can be accessed from the Welcome to Android Studio screen. It is essential where we need Live reloading of apps when code changes. Install WatchmanA Watchman is a tool used to watch files and record when they change. Press Ctrl + O (Write out)And press Ctrl + x (exit) 6. Sudo nano $HOME/.bash_profilePaste the copied code on the terminal screen and save the file using below commands. Here AwesomeProject is the project name. Create a new application using React NativeUsing react native CLI, we can create a new React Native project. Sudo npm install -g react-native-cli 8. We can easily install react-native CLI using NPM.Execute the below commands to install React native CLI. Install React Native CLIWe need to install React Native Command Line Interface(CLI) for creating and dealing with React Native projects. From the above link, we can download VS code. But in my case, I choose Visual studio Code(VS code). Choosing the Code EditorWe can choose our own favorite code editor for editing the project. Continually click the option until it enables the Developer optionsNow, return to Settings. Running the Application on Our Android DeviceNow we need to run the project on our Android phone(It is recommended to use Android 11.0 and higher devices, but lower versions are also compatible).We can see a Build Version menu there. Because we can use the Terminal without going out of our code editor.(Go to View -> Integrated Terminal from VS code’s top menubar) 11. Cd AwesomeProjectFrom now on, we can use VS code Terminal instead of native Ubuntu Terminal. The below commands will do this. Start EditingAfter installing VS code, direct to the project folder and open the project using it. ![]() Run with –info or –debug option to get more log output. I got the following error would appreciate any form of help thanks:A problem occurred configuring project ‘:app’.> The SDK directory ‘/home/user_directory/Android/Sdk’ does not exist.Run with –stacktrace option to get the stack trace. Everything went until I tried react-native run-android. These steps are compatible with any versions of Ubuntu.Thanks for the great tutorial. /gradlew app:installDebug -PreactNativeDevServerPort=8081 Run CLI with –verbose flag for more details.Error: Command failed. Make sure you have the Android development environment set up.
0 Comments
Leave a Reply. |
AuthorMike ArchivesCategories |