react-native-material-kit icon indicating copy to clipboard operation
react-native-material-kit copied to clipboard

cmath file not found

Open skumarcm opened this issue 4 years ago • 12 comments

I am trying to compile my react native application on iOS that makes use of react-native-material-kit

Following is the configuration: RN : 62.2 React: 16.11 react-native-material-kit: 0.6.0-beta.1 Platform: iOS

I am getting the followings Error while trying to compile and run the app on my iPhone from Xcode: 'cmath' file not found in the file: Pods/Flipper-folly/Math.h

This is caused by the following "include" directive in "node_modules/react-native-material-kit/iOS/RCTMaterialKit/TickView.m:9"

Has any one faced this issue?

skumarcm avatar Jun 21 '20 18:06 skumarcm

Same here

Kunalpaul12 avatar Jun 25 '20 12:06 Kunalpaul12

Yea same. It’s preventing me from upgrading a rn project and appears to be an issue with how this library is packaged. Any chance we can get an update?

tsabend avatar Jul 10 '20 21:07 tsabend

Same. I also tried:

  • :modular_headers => true

  • manually adding react-native-material-kit to the project

  • switching my C++ dialect and library in build settings

No dice, still getting 'cmath' file not found, coming from the same place as above.

mbdebbeler avatar Jul 13 '20 17:07 mbdebbeler

Same. Solved it by disabling flipper for the moment because we won't use it.

dfeliz avatar Jul 14 '20 14:07 dfeliz

Same problem for me

cristinaITdeveloper avatar Aug 03 '20 08:08 cristinaITdeveloper

Same thing. Also tried a myriad of things. Also, we have flipper in place. Maybe these 2 don't play well together.

sospedra avatar Aug 18 '20 17:08 sospedra

Same here

basnow28 avatar Aug 19 '20 08:08 basnow28

Same. Solved it by disabling flipper for the moment because we won't use it.

@dfeliz How did you disable flipper? The only way I can see to disable it involves changing a ton of files.

tastycode avatar Aug 19 '20 22:08 tastycode

This is the library I used instead: https://callstack.github.io/react-native-paper/index.html. As I was using the MKTextField from react-native-material-kit I could import similar component from react-native-paper. Hope this library can help someone :).

basnow28 avatar Aug 25 '20 09:08 basnow28

@tastycode you need to make the following changes to disable Flipper for now:-

PodFile(remove following) -

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'
  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end



  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
#  add_flipper_pods!


flipper_post_install(installer) 

AppDelegate.m(remove following)

#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif



  #if DEBUG
    InitializeFlipper(application);
  #endif


Let me know if it works.

salujaharkirat avatar Sep 09 '20 06:09 salujaharkirat

Temporary fix

Replace in file "react-native-material-kit"/TickView.m - "math.h" to <math.h>

AlexArtisan avatar Sep 22 '20 17:09 AlexArtisan

Temporary fix

Replace in file "react-native-material-kit"/TickView.m - "math.h" to <math.h>

It's work. @xinthink Can fix it in master branch?

thuytony avatar Dec 04 '20 18:12 thuytony