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.
Related
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.
I am an experienced android developer and started learning react native. I am using ubuntu to make a project. I used code like this one react-native init myprojectand am using visual studio code for code editor.
To run a project on my physical device I run adb devices on the terminal, change directory to project directory then I start localhost like react-native start then I start my project on android by this code react-native run-android. The project works fine on my physical device.
But I am getting an error when I use Expo (** I do not know what is expo is**). I am following the net ninja tutorial series. When I use expo-icons I get no icons. This is the tutorial link : icons
When today I was learning about how to use custom fonts in the react-native I got similar errors like this one shown in this link.
I do not know why does expo is not working on my project. Before following this series, I looked at the book to learn react-native which was saying that now we do not use expo. So how can I get out of this problem?
although i get few answer that clears what is expo and one have also answered the problem of icons in react-native . currently i am not able to use custom fonts in react-native .
Expo and react-native both are different CLI to create an applications.
Instead of using any components from expo in react-native application, you should use other packages. Since expo dependencies is not supported directly by react-native. (Correct me if I am wrong.)
Like, Instead of expo-icons you can use react-native-vector-icons
It will solve your current error.
so i got the answer of custom fonts from GitHub Facebook issue .
create react-native.config.js file in your root project folder than paste below code into that file
module.exports = {
project: {
ios: {},
android: {},
},
assets: ["./assets/fonts/"],
};
than you can use fonts as fontFamily : 'exact_file_name' after this process you will be able to see changes if you do not see any changes . re run your project via terminal and you should see changes of font in the project .
Thank You all the person who helped me .
I just started using expo for developing an app when I found out that apparently there are two different approaches into app development.
If I run:
expo init test
It prompts the following:
Choose a template: (Use arrow keys)
----- Managed workflow -----
❯ blank minimal dependencies to run and an empty root component
tabs several example screens and tabs using react-navigation
----- Bare workflow -----
bare-minimum minimal setup for using unimodules
If I chose bare-minimum option, I get the following directories:
android App.js app.json babel.config.js index.js ios node_modules package.json package-lock.json __tests__
So as if I chose blank I only get the following:
App.js app.json assets/ babel.config.js node_modules/ package.json package-lock.json
What I know so far: You can use React-Native, or Kotlin, or another language for different platforms.
What I don't quite understand: Apparently you can build your app with React-Native and get deeper access to platform resources with another language such as Kotlin, Java or Swift... Why is this necessary? Why you React-Native doesn't use full resources in the first instance? And finally, how react-native links with such a different languages?
You are using an Expo. Expo is a tool that assists React-native. If you want to use Java or SWIFT language, you must eject Expo. Create your own modules in JAVA or SWIFT and use them in React Native.
useful links:
Expo eject(ExpoKit)
Create Native Modules in ios
Create Native Modules in android
react-native link after Expo eject
I've been building some apps in react native using expo and wanted to see how the code looks in java in Android studio. I'm having trouble using decompiler(I've tried jadx, decompileandroid.com, and CFR). When I open the folder in android studio I can't find any source files other than classes named a,b,c,etc that have maybe 10 lines of code. I can't even find the strings that were in my app.
Does expo build the apk with proguard enabled? If so, is there a way to disable it? I have the react native source, I just want to see the java analogue. Is this a problem solely from using expo?
If you want to use a project you created using "expo" in your Android studio, you need to separate expo.
To separate, run 'expo eject'. This will result in an android file and an iOS file.
this is link about expo eject
ExpoKit is an Objective-C and Java library that allows you to use the Expo platform and your existing Expo project as part of a larger standard native project -- one that you would normally create using Xcode, Android Studio, or react-native init.
You can use the new Android file to run the Android studio.
I'am trying to integrate React Native to my existing Android app using the newest React Native version of 0.45.1.
The project setup is standard as created by the init command. In the android subfolder I checked out my existing Android app and followed the steps from Integration With Existing Apps
When running react-native run-android its gets me:
ENOENT: no such file or directory, open 'app/src/main/AndroidManifest.xml'
This is obviously due to my non standard Android project structure as I have several modules and my main module is not named app.
Now the actual question: Is there a way to configure the React Native layer and to tell it where my Manifest and possibly other required files reside?
Got is, pretty simple actually. --help is your friend.
--appFolder [string] Specify a different application folder name for the android source.
is exactly what I was looking for. For anyone who has similar troubles, there are some other interesting options as well.