Cannot read property 'openPicker' of undefined - react-native

I have installed library using pod file.
used this library
https://github.com/ivpusic/react-native-image-crop-picker
image selection from gallery working fine when I run code from x-code , but got above error when I run 'react-native run-ios'.
Any solution will be helpful.

Reason for this error:
The xcode could find the library in pods you need to install pods in order to make it work on iOS.
try running
pod install

Related

Library not found for -lreact-native-jitsi-meet ios

I'm getting an error while archiving the ios build with react-native-jitsi-meet and it works fine for debug. Already tried deleting pods and reinstalling pods, adding the library to linking.
enter image description here

How to properly include 'Firebase/Auth' pod for iOS or react-native project?

Goal: In a react-native project, I'm using react-native-firebase v5.6 and because im using Firebase's authentication, I need to include "Firebase/Auth" in the pod file so react-native-firebase's bindings can use it.
Problem: Once pod "Firebase/Auth" is added and saved to podfile, and pod install is successfully run, the project build fails when compiling RNFirebaseAuth.m. I haven't added any auth related code, just simply installed the pod and clean&ran build. Sidenote, other react-native-firebase setup/integration has been successful to this point.
Failing Error:
/path/to/project/node_modules/react-native-firebase/ios/RNFirebase/auth/RNFirebaseAuth.m:1184:36: error: no known class method for selector 'credentialWithProviderID:IDToken:rawNonce:'
credential = [FIROAuthProvider credentialWithProviderID:#"apple.com" IDToken:authToken rawNonce:authTokenSecret];
Have I just missed an installation step or what? How do I fix build?
According to mikehardy on GitHub, react-native-firebase v5.6 has a minor breaking change that enforces the use of firebase pods with at least version 6.13.
I ran pod update and that was all that was needed to fix the build

Linking API on React Native 0.61: openUrl is not a function

I'm trying to make sense of the Docs for the enabling the Linking API in React Native 0.61.5 on iOS.
https://facebook.github.io/react-native/docs/linking
The docs say that the library needs to be manually linked by following these steps:
https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking
But there's no .xcodeproj for Linking, under node_modules/react-native/Library/Linking or node_modules/react-native/Library/LinkingIOS, thus I have not manually linked the Library. Are there alternative instructions on manually linking the library?
When I try to call Linking.openUrl from my App right now, I get the following error:
TypeError: _reactNative.Linking.openUrl is not a function.
also, in my Podfile, I see this line:
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
Any help is greatly appreciated!
In case anyone is as unobservant as I am, it's openURL, not openUrl.
Just lost an hour on this.
For 0.60+, you don't need to do the manual-linking stuff. It uses cocoapods to do the linkings automatically.
Install Cocoapods: sudo gem install cocoapods
Then just go to /ios folder and do a pod install

React-native Xcode build fails -> 'RCTAssert.h file not found'

I did exactly the steps which are described here in the React-native getting started guide:
https://facebook.github.io/react-native/docs/getting-started.html
When I open the Project and build it, the build fails:
RCTAssert.h file not found' in MyProjectNameTests.m .
What am I missing?
Here are the steps from the getting started guide:
Requirements
OS X - This repo only contains the iOS (7+) implementation right now,
and Xcode only runs on Mac.
Xcode 6.3 or higher is recommended.
Homebrew is the recommended way to install io.js, watchman, and flow.
Install io.js 1.0 or newer. io.js is the modern version of Node.
Install nvm with its setup instructions here. Then run nvm install
iojs-v2 && nvm alias default iojs-v2, which installs the latest
compatible version of io.js and sets up your terminal so that typing
node runs io.js. With nvm you can install multiple versions of Node
and io.js and easily switch between them.
New to npm?
brew install watchman. We recommend installing watchman, otherwise
you might hit a node file watching bug.
brew install flow. If you want to use flow. We recommend
periodically running brew update && brew upgrade to keep your
programs up-to-date.
Quick Start
npm install -g react-native-cli
react-native init AwesomeProject
In the newly created folder AwesomeProject/
Open AwesomeProject. xcodeproj and hit run in Xcode. Open index.ios.js
in your text editor of choice and edit some lines. Hit cmd+R in your
iOS simulator to reload the app and see your change!
The test application can't find the header because it's not in the header search path.
In the left hand file list, hit the top left "folder" icon, then select your application at top left. In this case "AwesomeProject".
To the right of that, where the application icon appears, hold down to change to AwesomeProjectTests.
On the right side, click on the 'Build settings' tab.
Then scroll down to Header Search Paths and change "$(SRCROOT)/node_modules/react-native/React" to "$(SRCROOT)/../node_modules/react-native/React".
The app should now compile.
I got the same issue as daniel but I already have the right path in xcode ...
0.10.0 is my version
It's an issue in 0.10.0, and it has been fixed just now.
You need to re-generate your project. Refer to this PR: https://github.com/facebook/react-native/pull/2474
seeing same issue here and it seems react-native is latest on 0.10.0, i was using 0.8.0 and was running fine. May be to disable the test target for now?
Before testing any option from the above mentioned solutions, just clean your xCode and build the app again. That helped me
I had the same issue (I just had changed my apple ID password). I needed to redo the code signing configuration.
This happened to me on a React Native project.
I rolled back my code to a version that I knew built successfully and still got this error. How is this even possible? There's two hours of my life I'll never get back. I write this here on the chance I save you from the same fate.
In my case when I jump from my IDE in which I code my react-native project over to Xcode I open it from Spotlight.
At this point it is so easy to click the wrong icon on the right hand side. I accidentally clicked on the Xcodeproj file instead of the Xcworkspace. Easy to do, once it loads everything looks exactly the same, I was none the wiser.
The only indication that something had gone wrong was the build errors. Worse this error looks like a dependency management issue sending you down completely the wrong path in a resolution attempt.
This is not just a React Native specific issue, but something all Cocoapod users need to remember.
ADD the React Path to Podfile
platform :ios, '9.0'
target 'YourProject' do
...
pod 'React', :path => '../node_modules/react-native'
end
target 'RNFirebaseTests' do
...
pod 'React', :path => '../node_modules/react-native'
end

cocoa-pods failed to install pods for braintree framework in my app

I'm working on project in which I need to install braintree,
actually braintree was integrate and work fine but yesterday, it failed to compile with my project.
I am integrating Braintree SDK via Cocoa-pods and always open workspace instead of opening project file.
In start, it shows me issue regarding missing of library "-lPods-myProject-braintree"
then I delete cocoa-pods (uninstall it) again install it and repeat the whole cycle of integrating braintree SDKs via Pods but now it showing me issue,
First Time I also get this type of errors but finally it solved by one line.
please run following commands in Terminal
go to your project folder.
Be sure you have installed cocoapods in your system.
create pod file with command - nano podfile
write pod 'Braintree' in your podfile.
save podfile and run command pod install
If you get failed to install pod.
then run command pod try Braintree
You will surely get your pod installed in your project with xcodeworkspace file.