exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 554 forks source link

Issue with running it on the device #673

Open tomaszosk opened 4 years ago

tomaszosk commented 4 years ago

Hey,

I've been trying to use this framework - it is really great. When I run my project in Simulator everything works marvelously, however when I run it on a real device an error occurs:

dyld: Library not loaded: @rpath/Macaw.framework/Macaw Referenced from: /private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/ProjectName Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: code signature invalid for '/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw'

/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: stat() failed with errno=25 /private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: code signature invalid for '/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw'

/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: stat() failed with errno=1 /private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: code signature invalid for '/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw'

/private/var/containers/Bundle/Application/78DB2AB3-EB91-478F-AF73-C2FC112D7D08/ProjectName.app/Frameworks/Macaw.framework/Macaw: stat() failed with errno=1

I have found on Stack Overflow and other forums that it might be linked to Embedded Content, however I tried following the steps there, but nothing really worked. Have you had any issues with running projects using Macaw on your devices as well?

amarunko commented 4 years ago

Hi, @tomaszosk, no we haven't, which steps did you try?

tomaszosk commented 4 years ago

I built a project from the tutorial by Sean Allen on YouTube, link:

https://www.youtube.com/watch?v=hMyExC9swz8

and it works exactly as in the video on the simulator, however, when I run the same project on the device, the app crashes with 'Thread 1: signal SIGABRT' and the error mentioned above is displayed in the console.

I've read on Stack Overflow that this issue might be connected with a framework being missing and I have to 1) Add it manually in the Project > General > Frameworks, Libraries, and Embedded Content > '+' and to add Macaw and set it to: Embed & Sign 2) In Project > Build Phases > Dependences > '+' and add Macaw there as well

Reference: https://stackoverflow.com/a/59421812

I followed these steps, but the the building will fail with this error:

error: /Users/(..)/DerivedData/ProjectName-cevmdzifxaeyjghjdzhiivjcefsc/Build/Products/Debug-iphoneos/Macaw.framework: No such file or directory

I tried different variations (Build Settings > Linking > Runpath Search Paths, Build System > Legacy Build System, or removing Dynamic Frameworks from the Podfile), but nothing really worked

amarunko commented 4 years ago

Okay, I'll try to test this out

amarunko commented 4 years ago

Which version of cocoa pods do you use? Did you try to clean derived data?

cmld commented 4 years ago

I had the same problem

cmld commented 4 years ago

I solved this problem temporarily: change use_frameworks! to use_modular_headers! in the podfile file