React Native linear gradient package does not work on IOS - ios

i am trying to use this package https://github.com/react-native-community/react-native-linear-gradient
For ios i followed these steps;
npm i --save react-native-linear-gradient
react-native link
then i restarted my packager and run react-native run-ios
App works.
Then i import the package like
import RNAccountKit from 'react-native-facebook-account-kit';
Then app fails.
Here is the issue details;
https://github.com/react-native-community/react-native-linear-gradient/issues/323
any ideas ?

Instead of automatic installation try manual installation and try again

Related

react-native init does not create ios folder using last version 69.5

I'm new at react-native and I can easily create a react-native app using Expo, but there is no way using react-native init with Mac OS.
I have checked all the recommendations on internet, but the ios folder is never created.
Versions I have:
-Node v18.8.0
-Watchman v2022.08.22.00
-cocoapods v1.11.3
-xcode Version 13.4.1
I have tried all the recommendations I found: react-native upgrade, react-native-eject, reinstalling react-native-cli...,but no way.
I think that the template is not correct.
Can someone tell me how to solve this issue?
Expo updated today, just download the latest version of react-native. After creating the project, type in your terminal yarn add react-native#latest / npm install react-native#latest
Perhaps you mistyped, but rather than reinstalling react-native-cli try uninstalling:
npm uninstall -g react-native-cli
As suggested in the docs, globally installed react-native-cli can cause issues, and missing the iOS folder/incomplete init is indeed one of them.
Once global react-native-cli is installed re-run react-native init

error React Native CLI uses autolinking for native dependencies - RN iOS

I'm new to React native. I get the following error when I try to start the project in the ios simulator. How can I solve this?
Newer versions of React Native have autolinking, therefore you don't need to run commands like npx react-native link some-package-name to link the dependencies
In order to get rid of this error you need to unlink the dependency mentioned in the log, use the following instructions
Run npx react-native unlink #react-native-async-storage/async-storage
Run npm uninstall #react-native-async-storage/async-storage
Run npm install #react-native-async-storage/async-storage
Change to the ios directory cd ios and run pod install
That should solve this issue

React-Native error "RN Sketch not found in the UIManager"

I'm trying to build a react-native sketch project and I believe I've installed all the required libraries for it to work on my machine, but for some reason I keep on getting this error, which I'm not sure how to resolve.
Also, I wasn't sure what it meant by the linking of the react native to react native sketch, when installing the react-native sketch.
react-native link react-native-sketch
Maybe sharing your code will help debug the issue. But if the code is right then see below for installation.
So when installing this package, it is not enough to just install it. You must link to React Native. So do;
npm i -S react-native-sketch
That will install it. Now to make React Native 'aware' of this newly installed package, link it as follows;
react-native link react-native-sketch
This is just putting it in simple terms for understanding.
You should get a success message for both of the above - if an error occurs while running any of the above command lines, then it did not succeed and you'll get the error above.
If developing on IOS, don't forget to pod install and re run the project after installing the package!
CD to IOS directory - type 'pod install' and ENTER. Re Run the project.

React Native - AsyncStorage is null

I got these errores when I was adding AsyncStorage dependencies (https://github.com/react-native-community/async-storage)
I was using React Native CLI, not expo, I had ran 'react-native link #react-native-community/async-storage' in the project root.
My problem was when i ran '--clearCache' flag, maybe that was my problem, I don't know. If you know how to run the flag '--clearCache' please help me.
Try this
react-native link #react-native-community/async-storage
Then
Run react-native run-android
For me, 1. Reinstalling app 2. restarting bundler with npm start --reset-cache solved the issue! in Android

Can't require external react native Components

I'm currently trying to learn react Native. While building my first App I tryed to include a external Component from Github (https://github.com/voronianski/react-native-effects-view). Fallowing the small step by step instruction I installed the Component via npm npm install react-native-effects-view --save and included the native Code via XCode:
and required the Component via var EffectsView = require('react-native-effects-view');. After restarting the App I get the fallowing error: Error: Requiring unknown module "react-native-effects-view". If you are sure the module is there, try restarting the packager. (I did restart the package roughly 1000 times)
Maybe somebody can point out the mistake I did and explain me how to do it correct?
Thanks
Daniel
Try to run react-native run-ios. You need to run this after npm install.
you need to bundle your app again since emulator doesn't have the binary for react-native-effects-view module yet
so just run this command again
react-native run-ios

Resources