You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot ignore auto linking of un-supported library #414
System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 3.15 GB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.2.0 - ~/.volta/tools/image/node/14.2.0/6.14.4/bin/node
Yarn: 1.22.0 - ~/.volta/tools/image/yarn/1.22.0/bin/yarn
npm: 6.14.4 - ~/.volta/tools/image/node/14.2.0/6.14.4/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.0
System Images: android-28 | Google Play Intel x86 Atom, android-R | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages: react-native: Not Found
Issue
I'm first integrated react-native-vector-icons by some manuals steps, since the autolinking is not supported for the macOS platform yet, however, now I'm trying to integrate react-native-navigation and that does require that I do a pod install in the macos directory, but since RNVectorIcons is not supported the entire linking fails.
I tried adding a ignore entry in the react-native.config.js file:
/** * This cli config is needed for development purposes, e.g. for running * integration tests during local development or on CI services. */constpath=require(`path`);constblacklist=require(`metro-config/src/defaults/blacklist`);constrnmPath=path.resolve(__dirname,`node_modules/react-native-macos`);module.exports={resolver: {extraNodeModules: {'react-native': rnmPath,},platforms: [`macos`,`ios`,`android`],blacklistRE: blacklist([/node_modules\/react-native\/.*/]),},dependencies: {'react-native-vector-icons': {platforms: {macOS: null,},},},};
Steps to Reproduce
Modify react-native.config.js like I did above, that is, to ignore vector-icons package
Add react-native-vector-icons via npm or yarn
cd into macOS
do pod install
Expected Behavior
The incompatible package is ignored and the other packages can be linked like normal
Actual Behavior
The pod installation fails and nothing gets installed
I have actually hit this issue myself. A fix is to contribute to the react-native-vector-icons repo a change to add :osx to its podspec. But if there is a way to override the incompatible packages, I don't know. Eloy Durán (@alloy) : do you know if this is possible?
If you do need it for macOS, you will have to update its podspec to list :osx support, as @tom-un` said, there’s alas no way around that.
PS: This PR will make it so dependencies that don’t support :osx don’t get activated in macOS targets when auto-linking react-native-community/cli#1126
target 'tempomat-iOS' do
platform :ios, '9'
pod 'RNVectorIcons', :podspec => '../node_modules/react-native-vector-icons'
use_native_modules!
# Pods specifically for iOS target
end
and upon pod install I get the following:
Detected React Native module pods for RNKeychain and RNVectorIcons
Detected React Native module pod for RNKeychain
Analyzing dependencies
[!] There are multiple dependencies with different sources for `RNVectorIcons` in `Podfile`:
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
Thanks for the repro, turns out that the issue you’re seeing is because auto-linking code uses :path instead of :podspec, which is what the “different sources” part of the error message is getting at.
Hey, I just updated to the latest version of react-native-macos, yet this is still happening, any timeline when this change is going to land?
Thanks for the repro, turns out that the issue you’re seeing is because auto-linking code uses :path instead of :podspec, which is what the “different sources” part of the error message is getting at.
That diff is quite large, what exactly am I supposed to copy? there is a change on NativeModules.rb file on line 65 that seems the important one to skip dependencies that are not supported
Ah, just realized the CLI is a transitive dependency of react-native, when I tried with react-native 0.63 the ignored packages worked correctly, but I'm guessing it won't work with react-native-macos 62... so I guess it is only a matter of waiting until rn-macos adds rn 0.63 as a depedency right?
Activity
tom-un commentedon May 24, 2020
I have actually hit this issue myself. A fix is to contribute to the react-native-vector-icons repo a change to add
:osxto itspodspec. But if there is a way to override the incompatible packages, I don't know. Eloy Durán (@alloy) : do you know if this is possible?Thanks!
alloy commentedon May 25, 2020
If you don’t need
react-native-vector-iconsfor your macOS target, try explicitly activating it in your Podfile only in your iOS target definition:If you do need it for macOS, you will have to update its podspec to list
:osxsupport, as @tom-un` said, there’s alas no way around that.PS: This PR will make it so dependencies that don’t support
:osxdon’t get activated in macOS targets when auto-linking react-native-community/cli#1126ospfranco commentedon May 26, 2020
Eloy Durán (@alloy) doesn't seem to be working, I added the following:
and upon
pod installI get the following:alloy commentedon May 26, 2020
Hmm, that’s not good. I’ll see if I can repro this (or if you can provide a complete
Podfilethat exhibits the problem, that’d be much appreciated).ospfranco commentedon May 26, 2020
https://github.com/ospfranco/rn-macos-menubar-template it's pretty much a blank repo, just go into the macos folder and do pod install and you should get the error
alloy commentedon May 28, 2020
Thanks for the repro, turns out that the issue you’re seeing is because auto-linking code uses
:pathinstead of:podspec, which is what the “different sources” part of the error message is getting at.Having said that, changing to
:pathbrings us back to the original problem. One thing you could do, until a new version of the CLI is released, is to hot-patch your CLI installation with this change https://github.com/react-native-community/cli/pull/1126/files/9ef86dde56fa0446ffb53e1526fb9a8c1fc4a2a8#diff-d1800049b92343288bcbc1c484575058R63-R71ospfranco commentedon May 29, 2020
It's alright I can wait, I already have a workaround, thanks for the support!
ospfranco commentedon Oct 17, 2020
Hey, I just updated to the latest version of react-native-macos, yet this is still happening, any timeline when this change is going to land?
That diff is quite large, what exactly am I supposed to copy? there is a change on NativeModules.rb file on line 65 that seems the important one to skip dependencies that are not supported
ospfranco commentedon Oct 17, 2020
Ah, just realized the CLI is a transitive dependency of react-native, when I tried with react-native 0.63 the ignored packages worked correctly, but I'm guessing it won't work with react-native-macos 62... so I guess it is only a matter of waiting until rn-macos adds rn 0.63 as a depedency right?
alloy commentedon Oct 21, 2020
Yeah, then you’d definitely get the right version. Having said that, you can often update the CLI separately, have you tried that?
ospfranco commentedon Oct 22, 2020
I did not try it, should I just add @react-native-community/cli as a depency?
alloy commentedon Oct 22, 2020
Yup 👍
ospfranco commentedon Feb 15, 2021
This is working on the latest version