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.
Related
I'm trying to develop my first react-native app. Before I used capacitor, that creates for me the android/ios platforms inside my angular/react project and threat them just as normal assets.
ReactNative instead didn't create anything beyond my regular typescript project (I used expo-cli to setup). Problems arise when I try to use react-native-charts-wrapper, that asks me to manipulate gradle/pod file to use it (doc).
Thinking in general terms, it seems pretty weird that my project totally miss the android/ios native assets.
What am I missing? So what I'm supposed to do now?
After some research I found that to get the android/ios projects I need to setup my project with react-nativle-cli intead of expo-cli.
Instead of expo-cli, try react-native-cli, that resolved the same issue when I had faced it.
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.
I have an Android app built from scratch using React Native. Can I migrate the same app to iOS? If so, how tough will it be?
The Android app is already built and working fine.
If the app is done in React Native, you could build it using Xcode, of course you need a Mac, https://facebook.github.io/react-native/docs/getting-started#xcode.
You can also try from command line
react-native run-ios
Remember that you still need to install Xcode and the tools needed to build on the simulator or your device.
Also remember that you might have to do some changes in your code, not always the code for android works in iOS, moreover if you are using native modules done by you or from a library.
A project written in react-native should, by default, work on iOS.
Normally tho, every package you have used, some styles still differs from each other from platform, some things are avaiable to do on Android and not on iOS, some things are avaiable on iOS and not on Android.
Some packages needs linking. Some needs additional steps to run on iOS changing some datas/informations using xcode. (like deep linking).
On react-native 0.60 you need to install the pods manually as it's not done by the autolinking, there are a lot things to check and it may not be automatic for the majority of the cases
I'm programming on Expo for Android and I'm totally new to React-Native and Expo and really can't find something about a detached app's VCS on Expo docs, nor another similar question in the forums or SO (I "detached" my app because I needed React-Native-signature-capture).
Here are some things to have in mind:
We are a team of 2 developers working with the same app.
Each one manages his own tasks/issues
I'm the one who used to build the Expo app with my own expo account when the app was "attached".
When I was About to Stage SourceTree showed me this
The thing is, when I was about to stage and commmit React-Native code I saw all the /.expo-source and /android files and all that weights 10MB!... 10mb on a single commit, is that right? Is there something I can do about it? Do we need those files on VCS? Sorry for my bad english.
You don't need the Expo directory anymore. For Android, look at the React Native .gitignore here.
Also check if an .apk is trying to make its way into the repo. Add *.apk to .gitignore.
Well, those were all necessary files needed for the repo (my fault, I have lots of dependecies) also there were plenty of auto-generated files there (when you do gradle build these files are rebuild each time). So I kept managing the repo like I was doing before the Detach
We're working in an app for Android/IOS and the team has at least 3 people working in the app code and who need to have the app running locally in their particular env, someone is developing over Mac OS to eventually build to iOS and the others are on Windows machines.
We've been experiencing problems with the Ionic project after installing ngCordova, some cordova plugins and the ionic-platform-web-client, the mac machine had the app running beautifully and the windows instances were broken complaining that: Module 'ionic.service.core' is not available!
We don't know which particular step caused the code inconsistency and after several hours of looking around to fix it we decided just to create a new Ionic project and copy our specific www code inside. Since we don't want that to happen again we need to figure a reliable method of keeping all platforms working right after we install a plugin or add an Ionic service.
Could this be accomplished only by gitignoring www/lib folder and platforms, and then running bower install in each dev machine after a new module have been added to the project? or is it more complex than that and we're omitting some important steps to allow the project collaboration without these kind of issues?
Yes, you can put platforms in your .gitignore. I personally wouldn't be putting www/lib folder there, though.
Also, I would strongly advise that on all the machines where you're building the apps locally you have the same version of Ionic and Node.