Search Unity

Build error. Anything else getting hit with this

Discussion in 'iOS and tvOS' started by Shadowing, Dec 12, 2019.

  1. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ive been hit with this error inside xcode on Unity 2018.4.13 and 2019.2.15 with two different projects. One project has hardly anything in it.


    Code (csharp):
    1.  
    2. Undefined symbols for architecture armv7:
    3.   "_OBJC_CLASS_$_PHPhotoLibrary", referenced from:
    4.       objc-class-ref in iOSUtils.o
    5. ld: symbol(s) not found for architecture armv7
    6. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    7.  
    I thought maybe doing a 64 bit build only would fix it but apparently not

    Code (csharp):
    1.  
    2. Undefined symbols for architecture arm64:
    3.   "_OBJC_CLASS_$_PHPhotoLibrary", referenced from:
    4.       objc-class-ref in iOSUtils.o
    5. ld: symbol(s) not found for architecture arm64
    6. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    7.  
     
    Last edited: Dec 12, 2019
  2. Menn007

    Menn007

    Joined:
    Sep 20, 2015
    Posts:
    23
    Yes I get similar errors with Unity 2019.3.0f3. Have you found out how to fix these?
     
  3. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Still no. trying to send my 600mb project into unity but my upload keeps timing out cause my internet is god awful.
    will see if I can get it done today though.
     
  4. Menn007

    Menn007

    Joined:
    Sep 20, 2015
    Posts:
    23
    Do you think it could be because 2019.3 to X-Code is not fully compatible?

    I didn't get this error with a previous version of Unity 2019.3.
    It could also be something on apple's side ;-S
     
  5. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I lost internet for 2 and half days so that kept me from submitting the bug to Unity.
    Thanks for the information on that. I never tried with 2019.3
     
  6. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    "PHPhotoLibrary" is a PhotoKit class of iOS SDK. You may have been using a third party plugin because Unity does not link PhotoKit.

    To fix your linking issue, go to Frameworks and Libraries sections of your App Target settings (as shown below). Use the plus button to add PhotoKit reference.

    upload_2019-12-19_0-49-42.png
     
  7. Menn007

    Menn007

    Joined:
    Sep 20, 2015
    Posts:
    23
    Thanks Neonlyte,
    I'll give that a try..
     
  8. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Post back when you try please.
     
  9. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Neonlyte It comes up with a search box. When I search PhotoKit it can't find it?
     
  10. Menn007

    Menn007

    Joined:
    Sep 20, 2015
    Posts:
    23
    In my case the error was caused by the asset 'Universal Device Preview' I noticed there is a new update and it should be fixed.
     
  11. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    Sorry for the late reply. It seems that PhotoKit also go by "Photos.framework". Give that a try.
     
  12. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I finally submitted my project to Unity about this error. Will post back. sorry for the long wait. Had to wait for my internet to get fixed.
     
  13. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Alright Unity support told me how to fix this.

    For frameworks to be referenced automatically you'll need to mark them as dependencies at the plugin importer in Unity.
    In your situation iOSUtils plugin causes these undefined symbols and it can be resolved by enabling "Photos" in the "Rarely used frameworks" tab.


    so I searched IOSUtils in my Assets folder clicked on the file and clicked on "Rarely used frameworks" drop down list and checked Photos then hit import.
     
    RYL123 and Touah like this.
  14. rrabi

    rrabi

    Joined:
    Aug 4, 2015
    Posts:
    2
    Thanks man, i had the same issue and it resolved for me!
     
    RYL123 and Shadowing like this.
  15. CodeFluegel

    CodeFluegel

    Joined:
    Apr 8, 2015
    Posts:
    5
    Hejj guys - I can't find that Plugin? Is it in the asset store? could somebody link me that? :)
     
  16. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Did you hit apply after checking photos?
     
  17. RYL123

    RYL123

    Joined:
    May 17, 2017
    Posts:
    4
    Sorry, I deleted my previous reply by mistake.
    Now the problem has been solved, I have added "Photos.framework" in xcode, it's ok.

    upload_2022-1-18_12-18-18.png
    --------------------------------
    my previous reply:
    "Hello, I checked Photos and applied, but the error still exists, do I need any additional operations? I noticed you said "checked Photos then hit import ", but I don't see the import related button"
    upload_2022-1-18_12-7-3.png
     

    Attached Files:

    Last edited: Jan 18, 2022
  18. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Are you having to do that in xcode on every build?
     
  19. RYL123

    RYL123

    Joined:
    May 17, 2017
    Posts:
    4
    If I regenerate the xcode project, I need to manually add it once before building.

    I found that other people have encountered similar problems : check the library in "rarely used framework", but it is not added to the xcode project
     
  20. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Odd I dont have that issue at all. Entire point of selecting that in the unity editor is so you dont have to select it in xcode.

    What version of unity you using
     
  21. RYL123

    RYL123

    Joined:
    May 17, 2017
    Posts:
    4
    I think so, feel weird too. the version of unity I using is 2019.4.27f1.