Where is React Native Expo android folder? - android

I am using React native expo and I will install a plugin via github. However, in the documentation, changes are required in the /android/build.gradle folder. But my application does not have such a folder either. Can you help me ?
Github link: https://github.com/zo0r/react-native-push-notification

Expo Takes Care of .android & .ios folders. so it doesn't give you those files; but if you're sure you don't want expo, use:
expo eject
then, you have to install all expo dependencies which you installed using Expo.
but, if You're just asking for notifications, you may use:
expo install expo-notifications and use that you send both server and local notifications.
you may find more info here.

Related

React native, recreate ios and android folders

Couple of days ago I upgraded react-native project and also changed a lot of settings in my android and ios folders. After that it stopped to work properly and I deleted it. Now, I want to regenerate ios & android folder and make it work with my existing code. The question is: how can I do that?
Thanks!
As mentioned in the comments,
If you are using Expo as your development tool for react native, you can always reset the android and ios folders by running:
expo eject
from the command line when ever you need, just notice it will override changes made directly on these folders, so eject cerfully.

Android and ios folders missing in react native app

I created a react native app using expo init and I choose the blank (Typescript) template. Now I want to extract an apk but in the documentation, there is something to configure which is in the android folder, but I don't have it. I tried to find something but nothing worked. I run: react-native upgrade , react-native link , react-native run-android(Android project not found. Are you sure this...).
Is there a solution to generate those folders? And if I create an app with minimal (Typescript) template, the folders are there but it's also native android(java) and ios projects, and I want to know why.
I have react: 16.13.1 and react-native: 0.63.2.
I know that I could re-create the app with minimal template, but I don't want to add these folders to git.

How to make Android App from existing Angular web app using Cordova?

I have an Angular project web app, which is running successfully in the Apache web server after I built it with "ng build ..." command. Now, I want to make it Android App, for that, I tried to use Cordova. First I create a Cordova project then under www directory, I placed dist files from NG. Yes, I also used the Cordova platform add android before that. But, when I install apk in an emulator or on a real device it is appearing blank.
I google and found many links but none of them worked for me. Maybe I am doing wrong. Please guide me.
You need to be change base url at your dist folder and i don't suggest cordova for angular. You can choose the Nativescript for mobile apps and it's native. Because Cordova plugins are not very compatible with Angular.

React Native Eject but still being able to use React Native code

I've built some little prototypes within Expo with React Native but now I'm in the middle of a real project and I'm now discovering I will definitely need to eject my project for certain components to work.
My question is, once I eject, can I ever write React Native Code without having to init again which I assume will erase any changes I made at the native level?
Any techniques or references are appreciated.
Your question is a bit confusing, so I'll try to answer it as best as I can.
TL;DR: You will be able to write React Native code once you eject from Expo without having to use expo-cli init.
Expo Init
When you say "...can I ever write React Native Code without having to init again..." I assume you mean exp init (or expo-cli init) as opposed to react-native init. These commands merely initialize the project for you, so you shouldn't need to run them more than once.
For more information about how they differ from one another I recommend this GitHub issue thread.
Expo Eject
Expo allows you to eject your pure-JS project from the Expo iOS/Android clients, providing you with native projects that can be opened and built with Xcode and Android Studio. Those projects will have dependencies on ExpoKit, so everything you already built will keep working as it did before.
This means that when you eject your app you'll be writing React Native code outside of the Expo client environment, meaning you'll have access to the native code for Android and iOS. Even so, you will write normal React Native code (Javascript and JSX).
Also once you eject, Expo will add Expo Kit to your project which will give you access to some of Expo's features. For more information check their docs.

React Navigation (using Expo) - location of the MainActivity.java file?

I am going through the React Navigation documentation.
In the React Navgation - Getting Started instructions, it says that
"To finalise installation of react-native-gesture-handler for Android", I need to edit the MainActivity.java file.
However I don't have that file in my project, or any other similar directory pertaining to it (./android).
I created my project using expo-cli, in particular:
# To create a new React Native project
$ expo init project-name
# And to run the App in Expo
$ expo start
I am wondering if I have to create a build and how is it done, in order for Expo to create the files used by Android and iOS builds, or is there something else that I'm missing?
Expo
As you used Expo to create your app you will not have an android folder as these are abstracted away from you.
If you wish to use a dependency that requires you to edit native code then you need to eject your application. https://docs.expo.io/versions/latest/expokit/eject
From your command line run expo eject and it will build the necessary ios and android folders for you. However there are several ramifications if you eject your app. You should read the above link carefully.
react-navigation
However, as Expo recommend using react-navigation you don't need to install the react-native-gesture-handler as it is already installed in Expo
https://reactnavigation.org/blog/2018/11/17/react-navigation-3.0.html#installation
First, install the library using your favorite package manager:
yarn add react-navigation#^3.0.0
Next, install react-native-gesture-handler. If you’re using Expo you don’t need to do anything here, it’s included in the SDK.
It even mentions it on the installation instructions page https://reactnavigation.org/docs/en/getting-started.html#installation
Next, install react-native-gesture-handler. If you’re using Expo you
don’t need to do anything here, it’s included in the SDK. Otherwise:
react-native-gesture-handler
Similarly checking the documentation for react-native-gesture-handler it says:
Gesture Handler is already part of Expo and there is no extra
configuration required. However, consider that the Expo SDK team may
take some time to include the newest version of the library - so Expo
might not always support all our latest features as soon as they are
out.
https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html#with-expo-https-expoio
Creating a build with Expo
There is no point repeating the steps here to create a build with Expo it goes into quite some detail in the Expo documentation which can be found here https://docs.expo.io/versions/latest/distribution/building-standalone-apps

Categories

Resources