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
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.
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'm in a company, and we have a lot of build problems when we put a new developper on an existing react native projects. We all know that it can take hours or even days before he start to work.
We use fastlane and jenkins for deployment but we dont use anything for the local aspect (exept yarn/npm of course).
I guess those problems are caused by different version of build tool (cacoapod, gradle, react-native-cli ...) or different environments (even if we're all working on macos).
I was wondering if any of you have faced some similar situations and if you have some tips.
Maybe something like a "build server" can exist, or tools to automate build tool installation / setup with given versions (something like a package.json for build tools). Or other things that can help us.
A brief list of things that i often face:
Android: impossible to run anything via react-native command (no real debogger) Activity is not found
iOS: The app launch and close a little time during splashscreen
fastlane iOS: The build is working sometimes but it is really fortunate. It says that there are multiple reference to *.a files.
But my collegues face other problems. Our goal is to find a solution that can live over time. Like what a well configured docker can do with web project.
I am working on an android project that have later to be translated to many other languages and some changes have to do in design.
Now I want to know is there any way to make one project and keep it on git and later having changes should change the git project accordingly. So is it possible to create multiple apps for Android project. If yes, is it possible with Eclipse and git or someone has any other idea?
For the time being I am saving project in local directory and copy that project to make changes for next app.
This sounds that you should give git-subtrees a try. There, you create one repo with your base project and then import this repo into your specific app project. If you want to propagate your changes to the API, you push the changes to the base repo. We use this for component development.
But from my experience: do not use eclipse for working with git. It has some major drawbacks and might corrupt the repos. Use the CLI or another tool.
I'm new to developing apps with Cordova but I've got a lot working well. I just successfully implemented the 'phonegap-facebook-plugin'.
However, following the instructions, I put many files (from the facebook SDK and plugin) directly into the /platform/ios/ directory - which means instead of working in the root /www/ directory and building both platforms at once, my code is now less 'flexible' and is platform specific.
Is there a better way to do structure my files and/or workflow? Am I missing a step or a trick?
I appreciate any help.
Starting with Cordova 3.x, there is a new cordova command-line interface that will greatly help you organize code for multiple operating systems. You will use the CLI to create a project and then do all of your development in the main /www/ folder. You can then use the CLI to run commands that will copy your /www/ code into the appropriate place for web assets for each platform (like /myApp/assets/www/ for Android.)
Check out my answer here: Should a phonegap plugin be declared in the config.xml file?
I talk about how the directory structure that gets created, how you should version control /www/ and /merges/ folders, and how you can think about anything in /platforms/ as a build artifact. (The things in this folder aren't necessarily build artifacts but it's helpful to think about it that way if you are doing cross-platform work.)
If you are only developing for a single platform, or are hacking on the native pieces of the platform, then you will be inside these folders changing things. I don't recommend this approach for most people though because the vast majority of use cases are creating cross-platform apps with HTML5.
I have been working on the documentation to make this more clear. The new overview guide should help you: https://github.com/mbillau/cordova-docs/blob/30fb71d11b4db5d34b3ff1c48a16443d5fed1be3/docs/en/edge/guide/overview/index.md (If you read it and still have questions, please let me know so I can address those questions in the documentation and everyone will benefit.)
EDIT: I did not see that most of your question was about plugins. What should happen is that if you have a plugin updated for Cordova 3.x, then you should be able to install it with cordova plugin add .... This should copy the native and .js files into the /plugins/ folder for you. Then when you do cordova prepare it will copy the specific platform files for that plugin into the specific platform folder. So you shouldn't have to copy files all over the place. I'm pretty sure that the plugin you are using is not supported with 3.x though, in which case...I'm not really sure what to tell you. Running prepare should just copy over files, not erase files already there...but I'm not positive.