Expensify / react-native-share-menu

A module for React Native that adds your app to the share menu of the device
MIT License
643 stars 235 forks source link

[iOS] can't build Release with XCode 12.1 #89

Open CptMaumau opened 3 years ago

CptMaumau commented 3 years ago

Debug building works fine but once I try to build a Release version I get these warnings followed by plenty of errors when it's trying to build the Share Extension target.

ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftMetal'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftCore'

I've looked at multiple solutions like disabling Bitcode and I also already have a bridging header but nothing seems to fix it. Any run into this problem and solved it?

vvarda commented 3 years ago

@CptMaumau have you found the solution or workaround? Because that one didn't help.

CptMaumau commented 3 years ago

@vvarda I managed to build by excluding arm64 architecture but I still can't distribute my app through fastlane.

Screen Shot 2020-10-30 at 10 45 43 AM
matamicen commented 3 years ago

Guys, this library is working great in ios 14.2 with xcode 12.2(beta) and command line 12.2(beta) (download from Apple Developer Area).

here some tips that we did to avoid modulemap error and some others:

0) unistall old xcode 1) Xcode 12.2 and command line 12.2 (make sure the xcode path is from 12.2 and go to PREFERENCE form xcode 12.2 and select the latest command line you had downloaded and installed) 2) Update CocoaPods to 1.10 (supporting Xcode 12) 3) npm install (npm uses some of xcode 12.2 command line, otherwise it will throw errors or bad installation) 3) add the arm64 exclude architectures and DELETE VALID_ARCHS more info in this blog 4) pod install 5) may be has some failed on emulator becasue of Target issue, we accept the Xcode recomendation and build again and it works.

Hope it helps.

and Thanks for this library is great!

amine-ba commented 3 years ago

Still facing the same issue. @CptMaumau have you found the solution that can be used with Fastlane?

amine-ba commented 3 years ago

@matamicen Did you try build release and it worked for you ?

kodie commented 3 years ago

Adding arm64 to Excluded Architectures fixed the error for me, but now when I try to upload to the Apple Store I get the following error:

App Store Connect Operation Error
ERROR ITMS-90203: "Invalid architecture: Apps that include an app extension and framework must support arm64."
kodie commented 3 years ago

So removing the arm64 exclude allows me to build for release for a generic device and upload to the app store, however, the exclude is required to build for release for a specific device to run on an emulator. 🤷

quriosapien commented 3 years ago

@kodie As per my understanding, when you are in development phase, most of the things have to be build as per your laptop's processor which may not be arm architecture. But the iPhone devices which uses the app from AppStore are all arm based.

Hence this issue. I hope with M1 chips and successors, this will be resolved as everything would be arm based.