Skip to content

This seems related to #715 (previously closed). #718

@decode-kaku

Description

@decode-kaku

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

Hi @hyochan , thanks for helping me resolve the previous issues. However, I’m now encountering some new errors. Could you please assist me in fixing them completely? I’ve attached the log report below for reference.

SwiftCompile normal arm64 Compiling AudioEncoderAndroidType.swift, AudioQualityType.swift, AudioSet.swift, AudioSourceAndroidType.swift, AVEncoderAudioQualityIOSType.swift, AVEncodingOption.swift, AVLinearPCMBitDepthKeyIOSType.swift, AVModeIOSOption.swift, Func_void_PlaybackEndType.swift, Func_void_PlayBackType.swift, Func_void_RecordBackType.swift, Func_void_std__exception_ptr.swift, Func_void_std__string.swift, HybridSoundSpec.swift, HybridSoundSpec_cxx.swift, Logging.swift, NitroSoundAutolinking.swift, OutputFormatAndroidType.swift, PlaybackEndType.swift, PlayBackType.swift, RecordBackType.swift, Sound.swift (in target 'NitroSound' from project 'Pods')

Command:
cd <PROJECT_PATH>/ios/Pods
builtin-swiftTaskExecution -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c <PROJECT_PATH>/node_modules/react-native-nitro-sound/nitrogen/generated/ios/swift/AudioSet.swift [... and other Swift files ...]

Key compilation flags:
-target arm64-apple-ios15.1-simulator
-cxx-interoperability-mode=default
-sdk iPhoneSimulator18.1.sdk
-swift-version 5
-D RCT_NEW_ARCH_ENABLED
-std=c++20
-enable-experimental-feature DebugDescriptionMacro
-enable-experimental-feature OpaqueTypeErasure

ERROR DETAILS:
:1:9: note: in file included from :1:
#import "NitroModules-umbrella.h"
^
<DERIVED_DATA>/Build/Products/Debug-iphonesimulator/NitroModules/NitroModules-umbrella.h:30:9: note: in file included from NitroModules-umbrella.h:30:
#import "AnyMapHolder.hpp"
^
<PROJECT_PATH>/node_modules/react-native-nitro-modules/ios/utils/AnyMapHolder.hpp:13:2: warning: "AnyMapHolder.hpp is deprecated. Update Nitro to the latest version to use AnyMapUtils.hpp instead!"
#warning "AnyMapHolder.hpp is deprecated. Update Nitro to the latest version to use AnyMapUtils.hpp instead!"
^
<PROJECT_PATH>/node_modules/react-native-nitro-sound/nitrogen/generated/ios/swift/AudioSet.swift:153:41: error: function type mismatch, declared as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool' but used as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool'
return self.__OutputFormatAndroid.has_value() ? self.__OutputFormatAndroid.pointee : nil
^
:0: note: function declared here

<PROJECT_PATH>/node_modules/react-native-nitro-sound/nitrogen/generated/ios/swift/AudioSet.swift:170:41: error: function type mismatch, declared as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool' but used as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool'
return self.__AudioEncoderAndroid.has_value() ? self.__AudioEncoderAndroid.pointee : nil
^

<PROJECT_PATH>/node_modules/react-native-nitro-sound/nitrogen/generated/ios/swift/AudioSet.swift:187:49: error: function type mismatch, declared as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool' but used as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool'
return self.__AVEncoderAudioQualityKeyIOS.has_value() ? self.__AVEncoderAudioQualityKeyIOS.pointee : nil
^

<PROJECT_PATH>/node_modules/react-native-nitro-sound/nitrogen/generated/ios/swift/AudioSet.swift:272:47: error: function type mismatch, declared as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool' but used as '@convention(method) (__ObjC.std.__1.optional<>) -> Swift.Bool'
return self.__AVLinearPCMBitDepthKeyIOS.has_value() ? self.__AVLinearPCMBitDepthKeyIOS.pointee : nil
^

:0: error: multiple definitions of symbol '$sSo3stdO3__1O0017optional__xDEGbxaV9has_valueSbyF'
:0: note: other definition here
:0: error: multiple definitions of symbol '$sSo3stdO3__1O0017optional__xDEGbxaV9has_valueSbyF'
:0: note: other definition here
:0: error: multiple definitions of symbol '$sSo3stdO3__1O0017optional__xDEGbxaV9has_valueSbyF'
:0: note: other definition here
:0: error: multiple definitions of symbol '$sSo3stdO3__1O0017optional__xDEGbxaV9has_valueSbyF'
:0: note: other definition here

Library version

0.2.5

Project type

React Native (bare workflow)

React Native version

0.81

Expo SDK version (if applicable)

No response

Environment info

Xcode Version: 16.1
iOS Simulator SDK: 17.4
Target: arm64-apple-ios15.1-simulator
Swift Version: 6
React Native: New Architecture Enabled
Library: react-native-nitro-sound with react-native-nitro-modules
Error Type: Swift C++ interoperability std::optional multiple symbol definitions

Steps to reproduce

Image

Reproducible example repository

https://github.com/hyochan/react-native-nitro-sound

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions