isomorphic-webcrypto icon indicating copy to clipboard operation
isomorphic-webcrypto copied to clipboard

Migrate to Expo-Modules for Expo SDK 43 and newer

Open Termtime opened this issue 2 years ago • 8 comments

Using React : 17.0.2 react-native: 0.67.0 Expo SDK: 44 (Bare)

We are using this library due to the webcrypto polyfill.

This library is using expo unimodules, which causes a duplicate symbol issue on iOS, UMReactNativeAdapter belongs to expo unimodules. Could we get a version in which we don't depend on unimodules please? I would contribute but I currently have no idea how you have it set up for react-native support. No issues on Android

linking ProjectName

❌  duplicate symbol '_EXCanAskAgain' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_EXExpiresKey' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_EXGrantedKey' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_EXPermissionExpiresNever' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_EXStatusKey' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_CLASS_$_EXPermissionsService' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._moduleRegistry' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._requesters' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._requestersByClass' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_METACLASS_$_EXPermissionsService' in
> libExpoModulesCore.a(EXPermissionsService.o)
> UMReactNativeAdapter(EXPermissionsService.o)


❌  duplicate symbol '_OBJC_CLASS_$_EXReactNativeUserNotificationCenterProxy' in
> libExpoModulesCore.a(EXReactNativeUserNotificationCenterProxy.o)
> UMReactNativeAdapter(EXReactNativeUserNotificationCenterProxy.o)


❌  duplicate symbol '_OBJC_METACLASS_$_EXReactNativeUserNotificationCenterProxy' in
> libExpoModulesCore.a(EXReactNativeUserNotificationCenterProxy.o)
> UMReactNativeAdapter(EXReactNativeUserNotificationCenterProxy.o)


❌  ld: 12 duplicate symbols for architecture x86_64



❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)


error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ProjectName.xcworkspace.
info Run CLI with --verbose flag for more details.

Termtime avatar Mar 16 '22 01:03 Termtime

+1

olivierpascal avatar Apr 01 '22 19:04 olivierpascal

+1

marcato15 avatar May 09 '22 19:05 marcato15

+1

charlestbell avatar Jul 18 '22 21:07 charlestbell

I found a temporary workaround, which is to use Expo's classic build service, instead of their newer EAS build service. Unfortunately, the classic build service is deprecated and goes offline in about 160 days. So I'm reaching out to them and see if they can get EAS build to work like classic in this regard, or hold off on deprecating classic.

charlestbell avatar Jul 19 '22 18:07 charlestbell

Update: The EAS guys gave a kind of "not my problem" response. I also reached out to the guys in charge of microsoft's @azure/cosmos package and they're investigating finding a replacement for this package.

charlestbell avatar Sep 15 '22 17:09 charlestbell

For yarn I found the following resolutions 'hack' to be working:

{
  // ... other package.json options ...
  "resolutions": {
    "@unimodules/react-native-adapter": "./node_modules/expo"
  }
}

TimoGlastra avatar Jan 03 '23 14:01 TimoGlastra

I think this should be fixable by removing the dependency on the unimodules and instead updating to the expo modules. Not sure why it is needed to depend on the unimodules in the first place, couldn't we directly depend on expo-random?

@kevlened would you accept a PR for this change?

TimoGlastra avatar Jan 03 '23 15:01 TimoGlastra

@TimoGlastra i solve the problem right now. I've been trying to fix this for 50 hours, any solution that can be found is invalid. at last i just remove @unimodules/core and @unimodules/react-native-adapter in package.json which tell you to migrating expo under 44 to expo modules at first https://github.com/expo/fyi/blob/master/expo-modules-migration.md#migrating-to-expo-modules. then the build pass oh god.

czy0729 avatar Jan 04 '23 13:01 czy0729