Forum Xamarin.iOS

Unable to build the project after adding native library

I have created a iOS binding library and generated .dll to be used in Xamarin iOS application. I have added the .dll as reference. After this I am unable to build the project. Can I get to know what I have missed here ? The native sdk uses foundation framework only. I have attached the .a and generated dll here

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Can you provide build log under Help- Xamarin-Open Logs?

  • VamsiValiveruVamsiValiveru USMember ✭✭

    Please see the attached build log. Also, I am using this code in the link with.cs file:

    [assembly: LinkWith("libFDFreshchatSDK.a",
    //LinkTarget.Simulator | LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator64 | LinkTarget.Arm64,
    LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator,
    ForceLoad = true,
    Frameworks = "Foundation"
    //,LinkerFlags = "-lz"
    )]

  • VamsiValiveruVamsiValiveru USMember ✭✭

    I am able to use the dll (add as reference) and run on a simulator but not on the real device. I have used this for the linker attribute.

    Frameworks = "Foundation AVFoundation AudioToolbox CoreMedia CoreData ImageIO Photos SystemConfiguration Security"

    Also, I have attached the build log for real device. The fat library supports armv7, armv7s, arm64, i386 and x86_64 architectures

  • ColeXColeX Member, Xamarin Team Xamurai
  • VamsiValiveruVamsiValiveru USMember ✭✭

    Hi,

    I got the updated binding library dll and able to complile successfully in a simulator. When I run on a physical device, I am seeing a native error. I got the build output and see that a framework is missed. I added the framework (WKWebView) and I still see the error.

    This is my linkwith.cs code

    [assembly: LinkWith("libFDFreshchatSDK.a",
    LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.i386 | LinkTarget.x86_64 | LinkTarget.Arm64
    , SmartLink = true, ForceLoad = true
    , Frameworks = "Foundation AVFoundation AudioToolbox CoreMedia CoreData ImageIO Photos SystemConfiguration Security UIKit CoreGraphics WKWebView CFNetwork"
    , LinkerFlags = "-all_load -ObjC"
    )]

  • VamsiValiveruVamsiValiveru USMember ✭✭

    I have got it worked. Instead of the framework WebKit, I have added WKWebView in linkwith.cs file

Sign In or Register to comment.