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

Release Build for IOS #7

Closed kmamtora closed 1 year ago

kmamtora commented 3 years ago

While building release/debug ipa it gives error "Module 'StarIO10' not found"

Screen Shot 2021-04-16 at 3 36 09 AM

muhammadsr commented 3 years ago

Same issue. Any advice?

HungNguyenBao commented 3 years ago

Same issue

gare-bear commented 3 years ago

I'm not seeing that error on build.

Screen Shot 2021-04-29 at 3 35 09 PM

Running on an Apple M1

Did you already run the iOS setup instructions? https://github.com/star-micronics/react-native-star-io10/tree/master/example#ios

kmamtora commented 3 years ago

The steps which I followed in our project is

yarn add react-native-star-io10 / npm install react-native-star-io10 --save

added in info.plist

  1. NSBluetoothAlwaysUsageDescription (iOS 13.0 or later)
  2. NSLocalNetworkUsageDescription (iOS 14.0 or later)
  3. UISupportedExternalAccessoryProtocols (Add the following value to the array) jp.star-m.starpro

and in ios directory i did pod install

after that when we builkd the project this error shows

bandit-ibayashi commented 3 years ago

I reproduced the same error and was able to resolve it by deleting the cache. Could you try the following process?

  1. Delete example.xcworkspace, Pods folder, and Podfile.lock in the example/ios folder.
  2. Open "Terminal" app, and move to "example" folder, then do the following commands. watchman watch-del-all rm -rf ios/build rm -rf node_modules rm -rf ~/Library/Developer/Xcode/DerivedData yarn install cd ios pod install cd ..
  3. Open example.xcworkspace and do the build.
gelocreanordic commented 3 years ago

Experiencing this also as of now my Xcode Version is 12.2. This is happening only when archiving Im stuck with this as of now

devStar9211 commented 3 years ago

any solution ? I'm also stuck with this !!!

devStar9211 commented 3 years ago

I found solution. Plz add System Header Search Path like below

"${PODS_ROOT}/../../node_modules/react-native-star-io10/ios/libs/StarIO10.xcframework"

bandit-ibayashi commented 3 years ago

Unfortunately, I have not been able to reproduce this error even when creating an Archive.

Screen Shot 2021-05-31 at 6 15 28 PM

If the solution @devStar9211 found doesn't cause this issue, I would be very happy if you could report that to us. We appreciate your cooperation.

rashhhs commented 3 years ago

@bandit-ibayashi I have the same issue with non debug schemes (in my case test & release). It builds correctly in debug

image

I've tried all the suggestions that I found here, even what @devStar9211 said :(

user512 commented 3 years ago

I noticed I will always have this error when doing a release build on a simulator but won't hit this error when building on an actual device.

No error on simulator when doing a debug buiild.

kfernandes29 commented 3 years ago

I noticed I will always have this error when doing a release build on a simulator but won't hit this error when building on an actual device.

No error on simulator when doing a debug buiild.

Same here. I'm trying to run the simulator in Release mode to get screenshots for the AppStore. Keeps spitting out this error.

mengheangrat commented 3 years ago

Same issue. Any advice?

joarwilk commented 3 years ago

Same issue for me. Only on XCode 12+ however

mengheangrat commented 3 years ago

I try to restart my Mac, then reinstall it. Now it worked for me.

piyasil commented 3 years ago

Try go to Build Phases, then Link Binary with Libraries and Add StarIO10.xcframework. It works for me.

Screen Shot 2564-08-18 at 23 59 06
gerome-yocto commented 3 years ago

@piyasil hi, i tested and not work for me.

joarwilk commented 3 years ago

I got it working after a LOT of trial and error. No idea which one thing actually made it work, but here's what I tried (xcode 12.5.1):

Update Swift version

LIBRARY_SEARCH_PATHS = (
   "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
-  "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
+  "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"",
   "\"$(inherited)\"",
 );

Update ios target to at least ios 12

Update podfile as well as General > Deployment info in XCode

Get rid of Flipper (probably optional)

We dont use it, so no need to have to deal with its problems. Inside podfile:

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
- use_flipper!()
+ # use_flipper!()

Update Cocoapods to latest version

sudo gem install cocapods

Remove armv7 from active architectures

For some reason the lib has only been built for arm64, so change Build settings > Architectures > Architectures to arm64 instead of $(ARCHS_STANDARD)

Clean everything

Make sure to exit xcode before running these commands

watchman watch-del-all
rm -rf ios/build
rm -rf node_modules
rm -rf ~/Library/Developer/Xcode/DerivedData
yarn install
cd ios
pod install
gare-bear commented 3 years ago

If you've tried any of the suggestions in this post, and are still having issues building, please post a reaction to this comment.

joarwilk commented 3 years ago

@gare-bear It works if I follow my above list but not building for standard archs means the build is not valid in app store. Would you mind rebuilding and publishing the libs in ios/libs for armv7 as well?

Actually, how come the "ios/libs" folder exists in the first place? I havent seen it in other RN packages.

gare-bear commented 3 years ago

@joarwilk

Would you mind rebuilding and publishing the libs in ios/libs for armv7 as well?

I cannot but i'll ask @bandit-ibayashi to chime in and see if thats a possibility.

Actually, how come the "ios/libs" folder exists in the first place? I havent seen it in other RN packages.

Because our SDK talks to a piece of hardware, our SDK relies on some native APIs that RN can't offer. So when you build into a native app, each OS has its own set of "libs".

bandit-ibayashi commented 3 years ago

@joarwilk @gare-bear We are looking into. Thank you for your patience.

joarwilk commented 3 years ago

Thank you @bandit-ibayashi

For reference, here is the actual error (I think?). It precedes the "module not found" error:

warning: [CP] Unable to find matching .xcframework slice in 'framework ios-x86_64-simulator ios-arm64' for the current build architectures (arm64 armv7).

Brendan-csel commented 3 years ago

@joarwilk @gare-bear We are looking into. Thank you for your patience.

Thank you. Caught up on the same issue trying to build archive.

For what its worth, so far I've tried the above suggestions for search path and linking in project but still getting 'StarIO10' not found. I'm seeing this issue on my own machine, but also when building on appcenter.ms which sets up a whole new VM to do the build (so unlikely to be an issue with cached pods/data).

joarwilk commented 3 years ago

@Brendan-csel

I found this new commit: https://github.com/star-micronics/react-native-star-io10/commit/1392dff4d2992b30b70e6a051605f04a08c9fcc2

In there you have a couple changes to the xcode project file.

For me I got it working when i (like in the commit) added "$(SRCROOT)/node_modules/react-native-star-io10/ios/libs" to FRAMEWORK_SEARCH_PATHS, as well as added FRAMEWORK_SEARCH_PATH = "$(inherited) $(SRCROOT)/node_modules/react-native-star-io10/ios/libs"; next to it. Not sure if that second change is needed or just a typo but either way it worked!

Not sure why the changelog says May, I know for a fact that commit was not there a short while ago.

Brendan-csel commented 3 years ago

Thanks @joarwilk. I'm making a little progress.

I added HEADER_SEARCH_PATHS and FRAMEWORK_SEARCH_PATHS (but not FRAMEWORK_SEARCH_PATH) to my build settings. I still got errors related to this library not having arm7 support so I updated the build setting to also only support arm64.

After your Clean everything instructions above I can now get the Build Archive to complete - but will still be blocked if we can't publish to at least Test Flight without arm7 support in this library. Is there any way to work around needing that and still get our app out to clients?

Perhaps we can set UIRequiredDeviceCapabilities to arm64 in Info.plist in per this article. I'll try this but first time trying to publish to any store so it might take be a while to report back.

Hopefully @bandit-ibayashi will come back with an arm7 solution soon.

Brendan-csel commented 3 years ago

I've also noticed that when I restrict the architecture to arm64, all my simulators disappear in Xcode so I guess they also need armv7 support.

yachaka commented 3 years ago

Hello so I had the same issue and this happens because as said above, the framework is not built for armv7.

This means this can't be shipped for any < iPhone 5s or any < iPad 5th Gen device.

What worked for me (I didn't need to target those devices), was to change iOS deployment target to 12.0 (only iPhone 5s + have this iOS version), and change Architectures in Build settings to arm64

bandit-ibayashi commented 3 years ago

@Brendan-csel If the simulator is no longer showing up, could you please do the following if you can? This is our sample project, and it worked by appling this change.

recommend_setting
Brendan-csel commented 3 years ago

@Brendan-csel If the simulator is no longer showing up, could you please do the following if you can?

I don't see a Update to recommended settings option for my application project. There is one for the Pods project but not the application project.

Do you know what changed when you ran that?

yachaka commented 3 years ago

For me also if I do what I specified, the simulator is no longer showing up. I dont need the simulator as I'm developping on a device

But I guess this can be fixed by using Build setting Excluded architectures, setting Any iOS SDK to armv7 + Build only active architecture instead of using Architectures setting

Brendan-csel commented 3 years ago

But I guess this can be fixed by using Build setting Excluded architectures, setting Any iOS SDK to armv7 + Build only active architecture instead of using Architectures setting

Thanks for attempting to help. I didn't have any luck with these settings so just reverted the Architecture back to default, cleaned everything, rebuilt and ran simulators so I could get screenshots ...then repeated Architecture back to arm64 only, clean etc so I could Archive.

gare-bear commented 2 years ago

If you're still running into this issue and are willing to test a beta release, please contact the integration team to request access.

bandit-ibayashi commented 2 years ago

We have updated our React Native SDK to help resolve this issue. Thank you very much for your patience for a long time and your kindly cooperation!

Frankiz123 commented 2 years ago

@bandit-ibayashi i am still facing this issue in build release

Frankiz123 commented 2 years ago

@bandit-ibayashi I tried all possible solutions that everyone mentioned here but still, my ios build is crashing

bandit-ibayashi commented 2 years ago

Thank you for your report. But I'm afraid I have not yet been able to reproduce this issue in a latest environment.

Here is my result of npx react-native info and pod update.

% npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 12.3.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 427.90 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.2 - ~/.nodebrew/current/bin/node
    Yarn: 1.22.17 - ~/.nodebrew/current/bin/yarn
    npm: 8.7.0 - ~/.nodebrew/current/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 27, 30, 31, 32
      Build Tools: 30.0.2, 30.0.3, 32.0.0, 32.1.0
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66 => 0.66.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
% pod update
Auto-linking React Native modules for target `example`: RNCCheckbox, RNCPicker, and react-native-star-io10
Update all pods
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.66.0)
Installing FBReactNativeSpec (0.66.0)
Installing Flipper (0.99.0)
Installing Flipper-Boost-iOSX (1.76.0.1.11)
Installing Flipper-DoubleConversion (3.1.7)
Installing Flipper-Fmt (7.1.7)
Installing Flipper-Folly (2.6.7)
Installing Flipper-Glog (0.3.6)
Installing Flipper-PeerTalk (0.0.4)
Installing Flipper-RSocket (1.4.3)
Installing FlipperKit (0.99.0)
Installing OpenSSL-Universal (1.1.180)
Installing RCT-Folly (2021.06.28.00-v2)
Installing RCTRequired (0.66.0)
Installing RCTTypeSafety (0.66.0)
Installing RNCCheckbox (0.5.8)
Installing RNCPicker (1.16.8)
Installing React (0.66.0)
Installing React-Core (0.66.0)
Installing React-CoreModules (0.66.0)
Installing React-RCTActionSheet (0.66.0)
Installing React-RCTAnimation (0.66.0)
Installing React-RCTBlob (0.66.0)
Installing React-RCTImage (0.66.0)
Installing React-RCTLinking (0.66.0)
Installing React-RCTNetwork (0.66.0)
Installing React-RCTSettings (0.66.0)
Installing React-RCTText (0.66.0)
Installing React-RCTVibration (0.66.0)
Installing React-callinvoker (0.66.0)
Installing React-cxxreact (0.66.0)
Installing React-jsi (0.66.0)
Installing React-jsiexecutor (0.66.0)
Installing React-jsinspector (0.66.0)
Installing React-logger (0.66.0)
Installing React-perflogger (0.66.0)
Installing React-runtimeexecutor (0.66.0)
Installing ReactCommon (0.66.0)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing libevent (2.1.12)
Installing react-native-star-io10 (1.1.0)
Generating Pods project
Integrating client project
Pod installation complete! There are 56 dependencies from the Podfile and 47 total pods installed.

I was able to build and run the sample app without error in the environment above using the latest version v1.1.0 with using a release build and having it running in the iOS simulator.

Thanks.

bandit-ibayashi commented 2 years ago

I'm afraid this is Japanese but I found an article with a solution to the same error. https://ramble.impl.co.jp/2075/

From this article, this error Module 'StarIO10' not found is happend when this user would like to do "Archive" from Xcode to make an ipa file. And the solution is following:

  1. Update the version of react-native-star-io10 to the latest one.
  2. Add StarIO10.xcframework to Link Binary With Libraries. 20220701182624
bandit-ibayashi commented 1 year ago

Since it has been some time since this Issue was first reported to us, we would like to close it. If you continue to experience this problem, we would appreciate it if you could post it again.

Brettm12345 commented 1 year ago

I am still experiencing this problem and I have tried all the solutions in the thread

rob-langridge-lego commented 9 months ago

For anyone having this issue, we discovered this package doesn't really support a monorepo structure. If you're using yarn workspaces, add a nohoist in your root package.json. This worked for us after a lot of trial and error.

"nohoist": [ "**/react-native-star-io10"]

Brettm12345 commented 9 months ago

For anyone having this issue, we discovered this package doesn't really support a monorepo structure. If you're using yarn workspaces, add a nohoist in your root package.json. This worked for us after a lot of trial and error.

"nohoist": [ "**/react-native-star-io10"]

nohoist is deprecated in the latest version of yarn instead you need to modify the apps package.json with the following code

  "installConfig": {
    "hoistingLimits": "workspaces"
  }