Expo Camera - Development Build "This app is missing NSCameraUsageDescription" - react-native

I'm using the command expo run:ios to build my app on the phone using Expo's development build. I am also using the expo-camera component. However, when I navigate to the page with the camera, I get the following error from Expo.
"This app is missing NSCameraUsageDescription, so video services will
fail. Add this entry to your bundle's Info.plist"
What I've tried
I've tried adding "NSCameraUsageDescription" as a key in app.json as a child of "ios" > "infoPlist" > "NSCameraUsageDescription." However, I noticed the Info.plist generated in ios/expo/ still does not contain NSCameraUsageDescription.
I've also tried deleting the ios folder and rebuilding the project, but the problem still exists.

Related

Facebook.SDK not been initialized error in Expo Management App and expo/auth/session

I have an expo managed app that when I run in the production build, I getting the following error.
The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
So I added Facebook.initializeAsync('MyAppId') to the App.js file and I added the facebookAutoInitEnabled: true in the app.json file. It is a expo managed app, so I don't have access to the android native files before build time. Also, the app works for Facebook login when using the app in a simulator.
I followed this tutorial to setup Facebook login, in my app: https://derk-jan.com/2020/05/expo-facebook-login
Can somebody tell me how to properly make sure the Facebook SDK is initialized.
You should add the
facebookAutoInitEnabled: true
and
facebookAppId: 'MyFacebookAppId'
set in the app.json

local src file doesn't exist when trying to use expo go

So I'm new to React Native Expo and am trying to build a social app. Trying to test my app on my iPhone, I used my camera to scan the QR code provided by the Metro Bundler and tried to open my app on Expo Go. So I have different screens and a js file for each of the screens, and the bundler returns an error says the source code for the screens doesn't exist. It worked fine on a web browser on my computer. Any idea how to solve this? This might be a stupid question. Thanks a lot.
Here is a screenshot of the error:
error image

React Native Android debug build is using the prebuilt bundle instead of connecting to Metro

When I try to run my application on android using react-native run-android the app is not connecting to the Metro server but is using the bundle file in android/app/src/main/assets instead.
When I delete the bundle file I get two error screens that tell me that a bundle file could not be found and that a connection to the Metro server could not be made:
This happens on both my physical device and a local emulator, but on iOS devices everything works as expected. I'm pretty clueless what might be causing this. I've also tried deleting all the build output and node_modules without any result.
So after a lot of googling I found out what the issue was...
Some time ago the android API level was updated to level 28, and since API level 28 you need to specify if you want to use HTTP.
Metro uses HTTP for bundling so that's why it wasn't working.
I solved it by adding this line in the application part of AndroidManifest.xml:
android:usesCleartextTraffic="true"

React Native Expo publish to Android

I built a test application using react native. I'm trying to publish it following this tutorial: https://facebook.github.io/react-native/docs/signed-apk-android.html
However, my project does not have folder android. How can I create this folder?
In React-native, there are two method to create Singed APK File
First you should know
it's best to create apps using react-native init rather than expo as React-Native-Cli gives you local project for both ios and android,you can test and debug the code locally and also use the tool to publish applications
- If you create the project by using this command -
react-native init Project_Name
Then follow this method.
BUT IN YOUR CASE
you're using expo and also expo-cli! that's good! but when i use expo i usually like to go with expo XDE which has single version to publish,render or debug with it's own console in the bottom and that'll help you upload your code to expo server where you can ask them to render app for iOS or android and they will return you a link which will download the APK or the ipa file for android or iOS respectively
Here is the documentation link which'll explain you each step one by one and do keep an eye on the notes and TODOs while following the step (in your scenario)
- If you use expo,for create React-native project
then follow this method generate the singed APK file for Android - Expo

Can I not use Expo (cloud service) at all using React Native

I have build an app using react native(detached) but the thing is I would want to completely get rid of Expo. The reason is, what if one day EXPO service get shut down or no more supported.
So in this case I would not want the app to be affected.
Currently I need to publish my app thru ExpoKit to see the latest changes, how would I build my android app so it would not have any reference to Expo but still be able to work properly
Currently this is how I understand how the react native and expo works: first u build ur app using react native code and then a bundle.js is generated somewhere on cloud(EXPO) using publish command so the app communicate with that bundle.js.
Note I am not using any feature from Expo so why would I need Expo in this case?
Edited: If I am detaching my app from expo, I mean why would I still need Expo? Can't I just build the app and run the app without expo at all?
You can build your whole application without using expo, just follow the steps from facebook documentation in "Building Projects with Native Code" tab.
or
you can run "npm run eject" in your project root directory folder.
After this, you can build your appliaction using react-native cli commands, like
react-native run-android.
edited :--
For building apk for production, you can follow steps given in facebook documentation as generating signed apk and for released IPA for iOS yo can follow building your app for production for IOS.