star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
91 stars 55 forks source link

[REQUEST] Support `use_frameworks!` #90

Closed kickbk closed 7 months ago

kickbk commented 1 year ago

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.

marvinklein commented 1 year ago

@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.

kickbk commented 1 year ago

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.

bandit-ibayashi commented 1 year ago

@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 commented 11 months ago

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
lemaire31 commented 10 months ago

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?

bandit-ibayashi commented 9 months ago

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