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

Release Build for IOS

Open kmamtora opened this issue 3 years ago • 39 comments

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

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

kmamtora avatar Apr 15 '21 22:04 kmamtora

Same issue. Any advice?

muhammadsr avatar Apr 24 '21 04:04 muhammadsr

Same issue

HungNguyenBao avatar Apr 27 '21 10:04 HungNguyenBao

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

gare-bear avatar Apr 29 '21 19:04 gare-bear

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

kmamtora avatar Apr 29 '21 19:04 kmamtora

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.

bandit-ibayashi avatar May 12 '21 02:05 bandit-ibayashi

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

gelocreanordic avatar May 24 '21 13:05 gelocreanordic

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

devStar9211 avatar May 30 '21 17:05 devStar9211

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

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

devStar9211 avatar May 31 '21 02:05 devStar9211

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.

bandit-ibayashi avatar May 31 '21 09:05 bandit-ibayashi

@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 :(

rashhhs avatar Jun 28 '21 16:06 rashhhs

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.

user512 avatar Jul 06 '21 19:07 user512

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.

kfernandes29 avatar Jul 18 '21 13:07 kfernandes29

Same issue. Any advice?

mengheangrat avatar Aug 06 '21 03:08 mengheangrat

Same issue for me. Only on XCode 12+ however

joarwilk avatar Aug 06 '21 14:08 joarwilk

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

mengheangrat avatar Aug 08 '21 13:08 mengheangrat

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

piyasil avatar Aug 18 '21 17:08 piyasil

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

gerome-yocto avatar Aug 19 '21 07:08 gerome-yocto

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

joarwilk avatar Aug 23 '21 12:08 joarwilk

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

gare-bear avatar Aug 30 '21 19:08 gare-bear

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

joarwilk avatar Sep 02 '21 08:09 joarwilk

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

gare-bear avatar Sep 08 '21 14:09 gare-bear

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

bandit-ibayashi avatar Sep 20 '21 13:09 bandit-ibayashi

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

joarwilk avatar Sep 20 '21 15:09 joarwilk

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

Brendan-csel avatar Sep 20 '21 22:09 Brendan-csel

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

joarwilk avatar Sep 21 '21 08:09 joarwilk

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 avatar Sep 22 '21 01:09 Brendan-csel

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.

Brendan-csel avatar Sep 22 '21 04:09 Brendan-csel

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

yachaka avatar Sep 27 '21 23:09 yachaka

@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

bandit-ibayashi avatar Sep 29 '21 02:09 bandit-ibayashi

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

Brendan-csel avatar Sep 30 '21 03:09 Brendan-csel