Facing NSBundle issue at compile time. iOS

Hi all,
After an update to Xcode 13, app build is failing with Xcode13 command line tools in the Xcode as well as through the terminal.
It’s referring to the NSBundle issue, which is coming from iOS SDK 15 framework. Here’s the error while running from terminal or Xcode:
2 errors generated.
[19/17357] OBJCXX obj/base/base/ios_util.o
FAILED: obj/base/base/ios_util.o
…/…/third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/base/ios_util.o.d -DSYSTEM_NATIVE_UTF8 -DCR_XCODE_VERSION=1300 -DCR_CLANG_REVISION="n355885-a6ae333a-2" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_DEBUG=0 -DCR_LIBCXX_REVISION=375504 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DBASE_IMPLEMENTATION -DOPENSSL_NO_ASM -I…/… -Igen -I…/…/third_party/boringssl/src/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=…/…/tools/clang/crashreports -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -O0 -fno-omit-frame-pointer -g2 -Xclang -debug-info-kind=constructor -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -mios-simulator-version-min=12.0 -ftrivial-auto-var-init=pattern -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wglobal-constructors -Wexit-time-destructors -Wshadow -Wexit-time-destructors -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fobjc-call-cxx-cdtors -fno-exceptions -fno-rtti -nostdinc++ -isystem…/…/buildtools/third_party/libc++/trunk/include -isystem…/…/buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c …/…/base/ios/ios_util.mm -o obj/base/base/ios_util.o
In file included from …/…/base/ios/ios_util.mm:7:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString

  • (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
    ~~~~~~~~~~~~~~ ^ ~
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro ‘NS_FORMAT_ARGUMENT’
    #define NS_FORMAT_ARGUMENT(A) attribute ((format_arg(A)))
    ^ ~
    In file included from …/…/base/ios/ios_util.mm:7:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:130:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:168: error: expected ‘)’
  • (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
    ^
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:141: note: to match this ‘(’
  • (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;

I tried multiple ways which I found on the jetbrains page:
i. Upgrading kotlin to 1.6.21
ii. Passing “-DNS_FORMAT_ARGUMENT(A)=” in the compiler options. https://youtrack.jetbrains.com/issue/KT-48807/Cinterop-cannot-create-bindings-for-a-framework-when-Xcode-13-RC-is-installed#focus=Comments-27-5210791.0-0
iii. Tried modifying architecture of the project.

Note: Cinterop is not involved in the whole project.