marmelroy / PhoneNumberKit

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

`No such file or directory: '~/DerivedData` #743

Closed d-warfield closed 3 months ago

d-warfield commented 9 months ago

The following error occurs when running my app on an actual phone (not the simulator):

No such file or directory: '~/DerivedData/apple-client-kjiouewknasoiuqwelk/Build/Products/Debug-iphoneos/PackageFrameworks/PhoneNumberKit-Dynamic.framework/PhoneNumberKit-Dynamic'

It does, however, run fine on the simulator. Any ideas what's going on?

iPhone Model: iPhone 14 Pro Max iOS Version: 17.3 Xcode Version: 15.2

mfan0425 commented 8 months ago

Same issue with me

mfan0425 commented 8 months ago

It looks like a version issue. It might have been resolved. I updated the package to the latest version (3.7.9) and the issue disappeared.

ibrahim-alzant commented 8 months ago

Don't add the dynamic library.

ashoukr commented 6 months ago

Don't add the dynamic library.

This did not work.

workhitesh commented 6 months ago

Same issue with me too

ashoukr commented 6 months ago

Solution is to compile the project via command line.

Mohamed-Khaterr commented 6 months ago

Solution is to compile the project via command line.

When I try to build project via command line I did get this error

The following build commands failed: Copy /Users/UserName/Documents/MyApp/MyApp/build/Release-iphoneos/MyApp.app/PhoneNumberKit_PhoneNumberKit.bundle /Users/UserName/Documents/MyApp/MyApp/build/Release-iphoneos/PhoneNumberKit_PhoneNumberKit.bundle (in target 'MyApp' from project 'MyApp')

ashoukr commented 6 months ago

what I did exactly was remove the package, remove the derived data, reinstall the package, build via Xcode cli.

Solution is to compile the project via command line.

When I try to build project via command line I did get this error

The following build commands failed: Copy /Users/UserName/Documents/MyApp/MyApp/build/Release-iphoneos/MyApp.app/PhoneNumberKit_PhoneNumberKit.bundle /Users/UserName/Documents/MyApp/MyApp/build/Release-iphoneos/PhoneNumberKit_PhoneNumberKit.bundle (in target 'MyApp' from project 'MyApp')

iosdeviguru commented 6 months ago

Follow this same steps and same version it will solve this issue on real device

From Xcode 11+ :

Select File > Swift Packages > Add Package Dependency. Enter https://github.com/marmelroy/PhoneNumberKit.git in the "Choose Package Repository" dialog. In the next page, specify the version resolving rule as "Up to Next Major" from "3.7.0". After Xcode checked out the source and resolving the version, you can choose the "PhoneNumberKit" library and add it to your app target.

NOTE: Don't include Dynamic library only PhoneNumberKit

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.