null is not an object (evaluating '_RNGestureHandlerModule.default.Direction') - javascript

I followed the instructions for installing react-navigation 3.x from their website. I re-built the app and even created new project and followed the instructions again.
but still getting the same above error. any idea?
edit: I am running the app react-native cli using react-native run-ios. I am not using Xcode
error screenshot

Looks like this is to do with the new autolinking feature in RN 0.60.
To fix for now just add the following podspec for RNGesureHandler to ios/Podfile
pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'
Then in the ios directory run pod install to install it.

As mentioned here do the following:
Right Click Libraries "Add Files to Project"
/node_modules/react-native-gesture-handlers/ios/RNGestureHandler.xcodeproj
Go to build phases and add libRNGestureHandler.a
Run

I had this and solved by updating the pod spec and then rebuilding in Xcode.
# from project root
cd ios
pod update
Then re-run from Xcode

Related

React Native Windows App Loading Error (80072f78)

I'm new to react and react-native, and am attempting to run the react-native-windows template project but have encountered an issue.
Error
App loads in a blank window with error banner Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true
Image for reference
What I've Tried
I followed the instructions on the react-native-windows getting started docs
Namely:
npx react-native init <projectName> --template react-native#^0.63.2
cd projectName
npx react-native-windows-init --overwrite
npx react-native run-windows
The process will start another terminal window with the react logo. The application will build successfully, and will start in a new window. However, the original error is always present.
I've tried uninstalling and reinstalling all relevant programs. I've also tried building in both c# and c++, to no avail (adding the --language flag in the third step above).
Versions
react-native-windows: 0.63
react-native: 0.63.2
Windows SDK: 10.0.18362.0
node: 14.16.0
npm: 6.14.11
I couldn't find any issues like this online. If anyone has a suggestion, I would appreciate it. I'm more than happy to provide further info. Thanks!

Do we need to run pod install with Expo project

I'm new with app developing. I'm using react-native 0.63.2 and i've created my project with Expo.
There are no ios and android folders
So, should we have to have these folders to run pod install and correctly link the React Native app to the futur iOS app or this is not necessary anymore?
Because with the command npx create-react-native-app to create a project, they do exist.
Thanks.
You don't need to install Pod. Just run expo start or expo build:ios
No you don't need pod install here.. you can build your application without using xcode or android studio... expo handles it all :)

react-native-video: Cannot read property 'Constants' of null

I am trying to include a YouTube video in my react native project. Since I already tried react-native-youtube and did not work at all I tried installing react-native-video.
However, I am getting the following error:
I tried:
deleting my node_modules and npm i again followed by react-native link and react-native link react-native-video. Several times.
My package.json:
react-native: 0.63.4:
the problem is with linking, the issue got fixed by following these steps:
-removing the Pods folder from the ios folder:
-removing the node modules
-removing the build using this command: rm -rf ios/build
-running Yarn to reinstall the packages
-installing Pods using this command: cd ios && pod install --repo-update && cd ..
-running the ios build
-starting react native and removing the cache with this command: yarn start --reset-cache
This worked for me
react-native link
cd ios && pod install
check in podfile that react-native-video is added or not.
If not add it manually and run pod install.
then in xcode build Phases check search video , if you found video package already added then run app and check.
otherwise add it manually in Link Binary with Libraries.
and run app.

How to build react-native app for iOS properly?

I developed a react native app (version 57.4) on windows for android and it works fine.
Now I'm trying to build for iOS with no luck (as I don't have any experience with Xcode).
What I tried so far:
I knew that it requires a Mac and Xcode so I downloaded a VM, install Xcode.
Git clone myApp
react-native run-ios
But I got a lot of errors and build failures so after some search, I make these more steps:
react-native link
link some fonts manually
add a pod file and pod install
make some Xcode changes which I can't remember
react-native run-ios
And it works :)
BUT I had an issue with axios so I tried to fix it but I ruined the app so I removed the folder and re-cloned it again.
This time, I can't build successfully again!! and if it builds it crashes instantly!
My Question is what the exact steps do I need to make to build successfully on Mac (especially steps for Xcode)? including how to link all native dependencies correctly? and Is the pod file is necessary?

undefined is not object (evaluating 'RNDeviceInfo.deviceId') - error in react-native-device-info

I am using react-native-device-info library, and it works fine for iOS simulator. But for Android I receive an error:
undefined is not object (evaluating 'RNDeviceInfo.deviceId')
What can be the problem?
I installed it like is described in the guide on the library's page (using rnpm).
Then in componentWillMount() I am trying to get the device id:
import DeviceInfo from 'react-native-device-info';
...
componentWillMount() {
let clientId = DeviceInfo.getUniqueID();
}
In addition to rnpm install react-native-device-info and instruction from here, I had to manually add some lines to the following files:
<YourReactProject>/android/settings.gradle:
rootProject.name = 'YourReactProject'
include ':app', ':react-native-device-info'
project(':react-native-device-info').projectDir = newFile(rootProject.projectDir, '../node_modules/react-native-device-info/android')
<YourReactProject>/android/app/build.gradle:
...
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-device-info')
}
...
Rebuild by running react-native run-android
First check is it added to your package.json or not?
Then link the package with react native using following command
react-native link react-native-device-info
It manually links the package with react-native.
I am facing this issue in IOS.
Even I link the package it showing the same issue.
open your project in Xcode,
then under build phases add a binary file of react-native-device-info by clicking on the + button.
Rerun the project, It worked for me.
Firstly, make sure that react-native-device-info is linked in your project if you are using react-native version < 0.60.
If not linked, link it using react-native link react-native-device-info and then run react-native run-android command.
If using react-native version >= 0.60 skip this link command as auto-linking should work but make sure to run react-native run-android command.
and then use it using,
import DeviceInfo from 'react-native-device-info';
DeviceInfo.getUniqueId()
There is a small typo. You are using DeviceInfo.getUniqueID(); instead of DeviceInfo.getUniqueId()
Review in the documentation here
It looks like this package now uses Cocoapods. Run react-native link then check your Podfile for something like this:
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
If that's in there, then you just need to install / update your pods.
cd ios
pod install
or
cd ios
pod update
Make sure you restart the metro server and re-run react-native run-ios
use the manual installation and change
your project\node_modules\react-native-device-info\android\build.gradle'
dependencies {
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion"}
in here implementation as a compile

Categories

Resources