I have a .xcworkspace. I have an AppConstants.h in my main project and I need to import it in a file within some library which is connected in CocoaPods project. How can I import it?
I would not recommend you to do so,think about if you run PodInstall the next time, Your code would be overwritten.
What i would do, is just import the files as files, and not Cocoapods and then change them.
or you could build a Cocoapod your self and still use dependencies:
http://guides.cocoapods.org/making/making-a-cocoapod.html
Related
I am creating a React Native module as a wrapper for existing Android and iOS libraries. The Android library is a jar file and the iOS library is xcframework file. I put the xcframework file inside the ios folder, and the jar file inside android/libs folder ( I created the libs folder). I first tried the iOS library by adding s.preserve_path, s.xcconfig and s.vendored_framework inside the project level podspec file. I am not sure if I need to do anything for the pod spec file, like running it. So I just went along with the next step by trying to import the library's .h in .m file. I tried both using angle brackets <> and using quotes "". But none worked, because firing "react-native run-is" gave me this error: fatal error: file not found. Any help on how to include the libraries in react native is greatly appreciated.
For creating react native wrapper or node module you need use below library.
https://www.npmjs.com/package/react-native-create-library
https://github.com/brodybits/create-react-native-module
Using this library you can create empty react native module project after that you can bind your native code ARR or framework files into that project.
I was able to fix the error by doing the following two steps:
Change "s.vendored_framework" to "s.vendored_frameworks" in the project level .podspec file. My original one is singular (framework), not plural (frameworks).
cd iOS && pod install && cd ..
Step 2 can be found in create-react-native-module's GitHub link:
https://github.com/brodybits/create-react-native-module
I missed the second step when posting my question. I thought then that if I ran "react-native run-ios", it would run "pod install".
I'm trying to do platform specific imports as I add support for web app as well. But I keep running into an import error for "ActionSheetIOS". I don't use this anywhere in my code, but this is a dependency for some number of my packages (react-native-map-link, react-native-share, etc). I've read that having .native.js and .js files for the package would fix an issue like this. How can I change this dependency and have my other packages installed by npm read from these edited files? Is there another easier fix to this?
Edit: This is the specific error I am getting if it helps.
./node_modules/react-native-map-link/src/utils.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native'.
I've tried wrapping the code in the main files in Platform.OS selectors, so that's not the fix.
You can create specific js file like YourComponent.ios.js and YourComponent.android.js.
then import "ActionSheetIOS" in YourComponent.ios.js file. Also check this.
I've added a cordova plugin to my Meteor-Cordova project. Now I need to include it in the CDVAppDelegate.m. I've tried many variants (also tried solutions from other stack answers) but failed to import EGAnimatedFullScreenImage.h. How can I correctly import this file?
I've ended up successfully importing this header file in to another .m file located in the Plugins directory after Cleaning the project, reinstalling this plugin, and removing it from the Headers > Public
I am having issue in integrating Flurry in my project. When I place
import "Flurry.h"
In my AppDelegate. It say's Flurry.h file not found.
I added the whole Flurry folder in my project. As well as the stuffs you need to add in the building phase
Please use pods and add library in project. Follow this steps : https://developer.yahoo.com/flurry/docs/publisher/code/ios/#tab=0
Add all .dylib, .a and all respective dependancies.
And it should be #import "Flurry.h"
I have a development folder with the following folders (projects) inside it:
development: { baseByBase, vgo, virology-lib2}
Files in virology-lib2 are packaged with package ca.virology.lib2..;
Files in vgo are packaged with package ca.virology.vgo..;
So in my baseByBase project importing from virology-lib2 with import ca.virology.lib2...; works.
I want to import classes similarly from vgo into baseByBase, but import ca.virology.vgo..; doesnt work (cannot resolve symbol vgo). How do i import vgo classes into baseByBase? Why did it work for one import and not the other?
In IDEA terms, you have a project with three modules in it. In order one of them (baseByBase) to import classes from the others, it must depend either on the modules or on their output (jars). The third, ugly option is baseByBase module to have among its configured "source" folders a folder from another module (virology-lib2).
So open "File > Project Structure", and add "vgo" as a module dependency to the "baseByBase" module (see example in the screenshot below).