react-native-star-io10 icon indicating copy to clipboard operation
react-native-star-io10 copied to clipboard

[REQUEST] Support `use_frameworks!`

Open kickbk opened this issue 2 years ago • 6 comments

react-native-star-io10 currently does not support use_frameworks! which means it cannot work alongside many popular libraries, such as react-native-firebase. Flipper is another library that doesn't support use_frameworks! and trying to meddle with overrides in the podfile will ultimately fail if using Firebase storage or Firebase functions. Could we have react-native-star-io10 suuport use_frameworks! soon? Is it complicated to add support for it? If it's simply achievable some edits to the Podfile, please share instructions.

kickbk avatar Feb 23 '23 23:02 kickbk

@bandit-ibayashi we created a repo with a minimal project that reproduces this build-time issue: https://github.com/instamenu/starmicronics-example

The readme in that repo is an excerpt from the build log with the errors.

marvinklein avatar May 03 '23 16:05 marvinklein

For those looking for a working solution: https://github.com/kickbk/react-native-star-io10 It probably needs to be updated to integrate the updates from https://github.com/star-micronics, but it'll work. Some of the fixes we introduced in the fork are hardcoded and there's a need for matching your project's Kotlin version with the one used by the lib, hence the "kotlin" branch for lack of time adding it via a config plugin. I'm not currently maintaining this fork since I don't use the library in my project.

kickbk avatar Jul 20 '23 18:07 kickbk

@kickbk @marvinklein I'm afraid for not responding to this request for a long time.

Our React Native project uses native code, so we didn't consider Expo. But we noticed the official document that contained this sentence has been updated. So we are investigating this matter again, taking into account the hints we received from everyone.

We would like to thank everyone for their cooperation, and please wait a little longer to find out whether Expo will be possible or not, and if so, how we can respond.

bandit-ibayashi avatar Sep 08 '23 11:09 bandit-ibayashi

We found to be able to support "use_frameworks" by modifying .podspec file.

Method

  1. Download current react-native-star-io10 (yarn install , etc.)
  2. Add the following code to the react-native-star-io10.podspec file located in the node_modules directory.
  3. Build it.

Modification

Please add the following code the above s.vendored_frameworks = 'ios/libs/StarIO10.xcframework'.

  if ENV['USE_FRAMEWORKS']
    header_search_path = [
      '$(SRCROOT)/../../node_modules/react/** $(SRCROOT)/../../node_modules/react-native/**'
    ]

    exclude_source_file_name = [
      'libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/Headers/*.h libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/PrivateHeaders/*.h'
    ]

    s.pod_target_xcconfig  = {
      "HEADER_SEARCH_PATHS" => header_search_path.join(" "),
      "EXCLUDED_SOURCE_FILE_NAMES" => exclude_source_file_name.join(" ")
    }
  end

bandit-ibayashi avatar Dec 08 '23 09:12 bandit-ibayashi

We found to be able to support "use_frameworks" by modifying .podspec file.

Method

  1. Download current react-native-star-io10 (yarn install , etc.)
  2. Add the following code to the react-native-star-io10.podspec file located in the node_modules directory.
  3. Build it.

Modification

Please add the following code the above s.vendored_frameworks = 'ios/libs/StarIO10.xcframework'.

  if ENV['USE_FRAMEWORKS']
    header_search_path = [
      '$(SRCROOT)/../../node_modules/react/** $(SRCROOT)/../../node_modules/react-native/**'
    ]

    exclude_source_file_name = [
      'libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/Headers/*.h libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/PrivateHeaders/*.h'
    ]

    s.pod_target_xcconfig  = {
      "HEADER_SEARCH_PATHS" => header_search_path.join(" "),
      "EXCLUDED_SOURCE_FILE_NAMES" => exclude_source_file_name.join(" ")
    }
  end

@bandit-ibayashi will this fix be committed anytime soon?

lemaire31 avatar Jan 27 '24 18:01 lemaire31

We have released an updated version that includes the above reflections. Thank you for your patience!

bandit-ibayashi avatar Feb 13 '24 00:02 bandit-ibayashi