marmelroy / PhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
MIT License
5.13k stars 817 forks source link

PhoneNumberKit UnsafeMutableBufferPointer ans @Sendable errors #805

Open kallah94 opened 1 month ago

kallah94 commented 1 month ago

New Issue Checklist

Steps to reproduce

Flutter project run for iOS Flutter dependencies: _flutterfire_internals 1.3.40 (1.3.43 available) cloud_firestore 5.2.1 (5.4.2 available) cloud_firestore_platform_interface 6.3.1 (6.4.2 available) cloud_firestore_web 4.1.1 (4.3.1 available) collection 1.18.0 (1.19.0 available) firebase_auth 5.1.4 (5.3.0 available) firebase_auth_platform_interface 7.4.3 (7.4.6 available) firebase_auth_web 5.12.5 (5.13.1 available) firebase_core 3.3.0 (3.5.0 available) firebase_core_platform_interface 5.2.0 (5.3.0 available) firebase_core_web 2.17.4 (2.18.1 available) firebase_storage 12.1.3 (12.3.1 available) firebase_storage_platform_interface 5.1.27 (5.1.30 available) firebase_storage_web 3.9.12 (3.10.1 available) http_parser 4.0.2 (4.1.0 available) js 0.6.7 (0.7.1 available) leak_tracker 10.0.5 (10.0.7 available) leak_tracker_flutter_testing 3.0.5 (3.0.8 available) material_color_utilities 0.11.1 (0.12.0 available) meta 1.15.0 (1.16.0 available) shared_preferences_android 2.3.1 (2.3.2 available) string_scanner 1.2.0 (1.3.0 available) test_api 0.7.2 (0.7.3 available) vm_service 14.2.4 (14.2.5 available) web 0.5.1 (1.0.0 available)

Simulator on Iphone 16 and iOS 18

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

CFBundleDevelopmentRegion ${PODS_DEVELOPMENT_LANGUAGE} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 4.0.0 CFBundleSignature ???? CFBundleVersion ${CURRENT_PROJECT_VERSION} NSPrincipalClass
Expected result

Build ios app for simulator

Actual result

arseManager.swift:112:21: warning: capture of 'buffer' with non-sendable type 'UnsafeMutableBufferPointer' in a @Sendable closure; this is an error in the Swift 6 language mode buffer.baseAddress!.advanced(by: index).initialize(to: phoneNumber) ^ Swift.UnsafeMutableBufferPointer:1:23: note: generic struct 'UnsafeMutableBufferPointer' does not conform to the 'Sendable' protocol @frozen public struct UnsafeMutableBufferPointer : Copyable where Element : ~Copyable {

ParseManager.swift:112:21: warning: capture of 'buffer' with non-sendable type 'UnsafeMutableBufferPointer' in a @Sendable closure; this is an error in the Swift 6 language mode buffer.baseAddress!.advanced(by: index).initialize(to: phoneNumber) ^ Swift.UnsafeMutableBufferPointer:1:23: note: generic struct 'UnsafeMutableBufferPointer' does not conform to the 'Sendable' protocol

SwiftLibphonenumberPlugin.swift:7:25: note: cannot use module 'PhoneNumberKit' as a type let phoneNumberKit: PhoneNumberKit = PhoneNumberKit() @frozen public struct UnsafeMutableBufferPointer : Copyable where Element : ~Copyable {

Environment

AhmedRagabIssa commented 1 week ago

The same is happening in Xcode 16.1 Screenshot 2024-10-15 at 3 57 40 PM