Just a general question I couldn't quite find an answer for.
I've been developing a react native app and noticed that when I run it on android it works fine. But when I build and run it on ios it doesn't pick up some of my css changes or some features aren't working as expected.
Is there a reason for this or am I missing like some universal package for react-native?
Try running react-native run-ios in the command line
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 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
Is there any way to develop a React Native app for Android without installing Android Studio ?
On Ubuntu 18.04 the apt command proposes a lot of android packages: android-sdk, android-sdk-platform-tools etc...
What do I need exactly to get React Native working properly ?
Please don't use expo or another SDKs of react native. React Native CLI is recommended everywhere because its performance is not comparable to expo and it is much more lightweight! Android Studio is just an IDE! If you setup your android development environment correctly there is no need to install Android Studio IDE (This is for experts!) but it is recommended to install for amateur users.
If you don't want to use the Android studio, you can take advantage of the Expo. Expo is the best way to assist React-native. You can run the app without the Android studio, and when you refresh, you can see the modified code right away.
Look at this official document and follow it slowly.
you don't need Android Studio at all, if you are using react native cli you can install it on your phone and run it there.
An attempt of solution to use react native without android studio and without expo is to build directly in your device.
you must install adb first by following this link install-adb-fastboot-on-ubuntu 18.04
and then you should follow this link react-native running-on-device
It will help you.
I'm using usb cable to install debug apk in my phone (react-native run-android). I put my phone in the same network (WIFI) with my machine (server) and configure the server address and port to debug remotely in the phone. After that i remove the usb cable.
In short everything is explained on the link above
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.
Hello everybody I learn phonegap framework and I have few questions. I want to write app for android and ios. In android I write using Java and JavaScript so If I want to run it on other platform (like ios where is object-C) do I have to depend mostly on JS, move that code to MAC and build ios app??? I dont understand how to use my code in android and iOS... Do I need MAC? Do I need to know xcode?
If you are using cordova you have to use javascript/HTML/Jquery/Jquery Mobile/CSS, everything that you would use for the web.
Regarding the compilation if you have to work with IOS, you must have a MAC and then compile the project using xCode, but you do not need to know him well, you just need to know the process of publication.
For Android, you can instead use Ecplise.
If you want to develop cross-platform on an Android IDE, such as Eclipse then there is no need for a Mac & Xcode outside of testing. However, if you're saying that you already use Xcode and write in Obj-C then have a look at this tutorial to get you started:
http://www.raywenderlich.com/30734/phonegap-tutorial-a-cross-platform-zombie-app
Or this for a JQM/Android example:
http://www.gajotres.net/building-a-native-mobile-app-with-phonegap-and-jquery-mobile-1-4/