Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ios noob trying to link in CoreNFC

Discussion in 'iOS and tvOS' started by Publicus, Dec 4, 2019.

  1. Publicus

    Publicus

    Joined:
    Aug 4, 2017
    Posts:
    2
    I'm trying to write a unity app using nfc but I don't seem to be able to get xcode to link in the framework.

    I've added the framework in xcode and tried both "Do not embed" and "Embed & Sign" but I still get a link error

    Undefined symbols for architecture arm64:
    "_OBJC_CLASS_$_NFCTagReaderSession", referenced from:
    objc-class-ref in NFCPlugin.o
    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    which isn't surprising because the framework isn't being added to the link command

    Ld /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework normal arm64

    cd /Users/jerome/Projects/talking-stars/TalkingStars/talking-stars

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios13.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -L/Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Products/ReleaseForRunning-iphoneos -L/Users/jerome/Projects/talking-stars/TalkingStars/talking-stars/Libraries -L/Users/jerome/Projects/talking-stars/TalkingStars/talking-stars/Libraries/com.unity.xr.arkit/Runtime/iOS -F/Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -map -Xlinker /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -liPhone-lib -framework Security -framework MediaToolbox -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp /Users/jerome/Projects/talking-stars/TalkingStars/talking-stars/Libraries/com.unity.xr.arkit/Runtime/iOS/UnityARKit.a -framework ARKit -weak_framework Metal -Xlinker -dependency_info -Xlinker /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_dependency_info.dat -o /Users/jerome/Library/Developer/Xcode/DerivedData/Unity-iPhone-euyszywhacxbqihirsuyvkcleyhs/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework

    Is there something special i need to do to add additional frameworks when building unity apps for ios?
     
  2. Krusty666

    Krusty666

    Joined:
    Feb 24, 2020
    Posts:
    5
    Do you use swift to communicate with the framework?
    and how do you add the framework?