Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native 0.72.3 issue building on v10.0.0 #1534

Closed
billnbell opened this issue Jul 26, 2023 · 11 comments
Closed

React Native 0.72.3 issue building on v10.0.0 #1534

billnbell opened this issue Jul 26, 2023 · 11 comments

Comments

@billnbell
Copy link

▸ Compiling RNVectorIconsManager.m

❌  /Users/bill_1/theclub/TheClub/ios/build/generated/ios/RNVectorIconsSpec/RNVectorIconsSpec.h:15:2: This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.

#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
 ^



❌  /Users/bill_1/theclub/TheClub/ios/Pods/Headers/Public/RCTRequired/RCTRequired/RCTRequired.h:8:10: 'utility' file not found

#include <utility>
         ^~~~~~~~~



❌  /Users/bill_1/theclub/TheClub/node_modules/react-native/Libraries/TypeSafety/RCTConvertHelpers.h:8:9: 'optional' file not found

#import <optional>
@billnbell
Copy link
Author

OK I was able to fix it. 3 things need changing fr RN 0.72.3.

  1. Rename RNVectorIconsManager/RNVectorIconsManager.m to RNVectorIconsManager/RNVectorIconsManager.mm
  2. Fix RNVectorIcons.podspec (for lower version < 0.72 you will need to check for fabric before adding install_modules_dependencies(s))
require 'json'
version = JSON.parse(File.read('package.json'))["version"]

fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

Pod::Spec.new do |s|

  s.name           = "RNVectorIcons"
  s.version        = version
  s.summary        = "Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling."
  s.homepage       = "https://github.com/oblador/react-native-vector-icons"
  s.license        = "MIT"
  s.author         = { "Joel Arvidsson" => "joel@oblador.se" }
  s.platforms      = { :ios => "12.4", :tvos => "9.0" }
  s.source         = { :git => "https://github.com/oblador/react-native-vector-icons.git", :tag => "v#{s.version}" }
  s.source_files   = 'RNVectorIconsManager/**/*.{h,m,mm,swift}'
  s.resources      = "Fonts/*.ttf"
  s.preserve_paths = "**/*.js"
  s.pod_target_xcconfig = {
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
  }

  if fabric_enabled
    s.dependency "React-utils"
    s.subspec "xxxutils" do |ss|
      ss.dependency "ReactCommon"
      ss.dependency "React-utils"
      ss.source_files         = "react/utils/**/*.{cpp,h}"
      ss.header_dir           = "react/utils"
      ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" }
    end
  end

  install_modules_dependencies(s)

end
  1. FIx name of turbo module
-    return std::make_shared<facebook::react::RNVectorIconsSpecJSI>(params);
+    return std::make_shared<facebook::react::NativeRNVectorIconsSpecJSI>(params);

@billnbell billnbell changed the title React Native 0.72.3 issue building React Native 0.72.3 issue building on v10.0.0 Jul 27, 2023
@mbrimmer83
Copy link

Changing RNVectorIconsManager/RNVectorIconsManager.m to RNVectorIconsManager/RNVectorIconsManager.mm fixed my build

@johnf
Copy link
Collaborator

johnf commented Aug 15, 2023

@billnbell Similar to my question in #1538, should #1530 solve this?
I've tested with NO_FLIPPER=1 USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1 pod install
and it seems to compile fine with the patch

@johnf
Copy link
Collaborator

johnf commented Aug 15, 2023

Although it also seems to compile without in my testing

@billnbell
Copy link
Author

Yes!

@akerele-doftwerks
Copy link

OK I was able to fix it. 3 things need changing fr RN 0.72.3.

  1. Rename RNVectorIconsManager/RNVectorIconsManager.m to RNVectorIconsManager/RNVectorIconsManager.mm
  2. Fix RNVectorIcons.podspec (for lower version < 0.72 you will need to check for fabric before adding install_modules_dependencies(s))
require 'json'
version = JSON.parse(File.read('package.json'))["version"]

fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

Pod::Spec.new do |s|

  s.name           = "RNVectorIcons"
  s.version        = version
  s.summary        = "Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling."
  s.homepage       = "https://github.com/oblador/react-native-vector-icons"
  s.license        = "MIT"
  s.author         = { "Joel Arvidsson" => "joel@oblador.se" }
  s.platforms      = { :ios => "12.4", :tvos => "9.0" }
  s.source         = { :git => "https://github.com/oblador/react-native-vector-icons.git", :tag => "v#{s.version}" }
  s.source_files   = 'RNVectorIconsManager/**/*.{h,m,mm,swift}'
  s.resources      = "Fonts/*.ttf"
  s.preserve_paths = "**/*.js"
  s.pod_target_xcconfig = {
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
  }

  if fabric_enabled
    s.dependency "React-utils"
    s.subspec "xxxutils" do |ss|
      ss.dependency "ReactCommon"
      ss.dependency "React-utils"
      ss.source_files         = "react/utils/**/*.{cpp,h}"
      ss.header_dir           = "react/utils"
      ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" }
    end
  end

  install_modules_dependencies(s)

end
  1. FIx name of turbo module
-    return std::make_shared<facebook::react::RNVectorIconsSpecJSI>(params);
+    return std::make_shared<facebook::react::NativeRNVectorIconsSpecJSI>(params);

where did you get these files from? @billnbell

@lucaswitch
Copy link

It's under node_modules/react-native-vector-icons/RNVectorIcons.podspec

@lucaswitch
Copy link

This error is happening on 0.72.4, with RCT_NEW_ARCH_ENABLED=1
Screenshot 2023-09-04 at 16 04 12

@jorgegvallejo
Copy link

This error is happening on 0.72.4, with RCT_NEW_ARCH_ENABLED=1 Screenshot 2023-09-04 at 16 04 12

Same with 0.72.5

@dmg46664
Copy link

dmg46664 commented Oct 4, 2023

Will this be addressed?
Edit: Ah, downgrading to 9.2.0 worked for me 😀

@johnf
Copy link
Collaborator

johnf commented Oct 7, 2023

Closing in favour of #1538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants