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

[REQUEST] Support use_frameworks! #90

Closed
kickbk opened this issue Feb 23, 2023 · 6 comments
Closed

[REQUEST] Support use_frameworks! #90

kickbk opened this issue Feb 23, 2023 · 6 comments
Labels
good first issue Good for newcomers Status: fixed Enhancements that have been requested and implemented Target: other Type: enhancement New feature or request

Comments

@kickbk
Copy link

kickbk commented Feb 23, 2023

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
Copy link

@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
Copy link
Author

kickbk commented Jul 20, 2023

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
Copy link
Member

@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
Copy link
Member

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 bandit-ibayashi added Status: work in progress Currently working on this issue and removed Status: triage Start out by looking at issues labels Dec 12, 2023
@lemaire31
Copy link

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 added a commit to lemaire31/react-native-star-io10 that referenced this issue Jan 28, 2024
lemaire31 added a commit to lemaire31/react-native-star-io10 that referenced this issue Jan 29, 2024
lemaire31 added a commit to lemaire31/react-native-star-io10 that referenced this issue Jan 29, 2024
@bandit-ibayashi
Copy link
Member

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

@bandit-ibayashi bandit-ibayashi added Status: resolved Solved or Answered and removed Status: work in progress Currently working on this issue labels Feb 13, 2024
@can-miki can-miki added the good first issue Good for newcomers label Apr 26, 2024
@can-miki can-miki added Status: fixed Enhancements that have been requested and implemented and removed Status: resolved Solved or Answered labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Status: fixed Enhancements that have been requested and implemented Target: other Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants