0

I'm binding a Xcode Project like this:

enter image description here

enter image description here

Then, I created a static library contains code in DevQPSDKCore directory and reference QPSDKCore.framework, produces library libQupaiSDK.a

Finally, created a new Xamarin binding library

enter image description here

libQupaiSDK.linkwith.cs

enter image description here

Run the project get error:

MTOUCH: error MT5209: Native linking error: framework not found QPSDKCore for architecture arm64
MTOUCH: error MT5202: Native linking failed. Please review the build log.

When I remove the libQupaiSDK.a, this project run successfully.

I can't get the reason from xamarin logs, any body can help me, thanks.

Update:

These two libraries are fat libraries.

$ lipo -info libQupaiSDK.a  
Architectures in the fat file: libQupaiSDK.a are: i386 armv7 x86_64 arm64  
$ lipo -info QPSDKCore.a  
Architectures in the fat file: QPSDKCore.a are: armv7 i386 x86_64 arm64 

Xamarin Studio 6.1.2(build 44)
Xcode 8.1(8B62)

BTW,-lz is dylib or tdb in Xamarin.iOS ?

SDK Source

Lei Kan
  • 487
  • 7
  • 20

2 Answers2

0

The file libQupaiSDKBinding.a was compiled referencing QPSDKCore.framework, not QPSDKCore.a library

.a file references framework

What you need to do is remove QPSDKCore.a file from the binding project and reference QPSDKCore.framework correctly (see topic on embedding frameworks).

Basically, copy over QPSDKCore.framework to the Qupai.iOS project folder and edit .csproj file adding these lines:

  <ItemGroup>
    <NativeReference Include="QPSDKCore.framework">
      <IsCxx>False</IsCxx>
      <Kind>Framework</Kind>
    </NativeReference>
  </ItemGroup>

After reloading project you will see your framework as a reference project and you will be able to compile and run the app.

Note the change in .csproj on the left and native reference on the right.

running your app after suggested changes

Must say the error you had was kind of cryptic and if your post didn't include details about the XCode part, I would not able to find the solution.

Alex Sorokoletov
  • 3,102
  • 2
  • 30
  • 52
  • Alex, I have another question, I had binding some frameworks by reference .a directly, and those work well before, why this sdk fail? – Lei Kan Dec 06 '16 at 06:58
  • Good question. Short answer - no. This one fails cause you are binding actually a `.a` library X that already references framework Y. When compiling all this together in a final app, linker can't find framework Y (even though you have a Y-named library). In your case if you wanted to use the Y framework only (without X library) you could bind it as a framework and as a library. Dependency between X and Y is key here – Alex Sorokoletov Dec 06 '16 at 17:55
  • 1
    I will recheck the framework reference path. Thanks for your detailed explanation. Have a good day. :) – Lei Kan Dec 07 '16 at 01:31
  • @AlexSorokoletov Hi Alex,can you please see this question http://stackoverflow.com/questions/42962939/xamarin-ios-binding-libraries-native-frameworks . Spasibo :)! – XTL Mar 27 '17 at 11:48
0

I had the same issue for MicroBlink library. and the error disappeared after downloading the library again.

Look at this Link

This error is related to the fact that there is no framework (binary) found in the repository.

The repository contains a git submodule to the BlinkID SDK (native). BlinkID SDK has binary stored on git lfs (large file storage).

So we would recommend the following

  1. install git lfs
    brew install git-lfs
    git lfs install

Note: if you don't have Homebrew installed, follow the instructions from here: http://brew.sh

  1. clone the repository and use the cloned repo instead of just regular download. Clone is important because the repository contains submodules.
    git clone git@github.com:BlinkID/blinkid-xamarin.git

  2. Fetch all submodules

    cd blinkid-xamarin
    git submodule init
    git submodule update --recursive

  3. After that, try the BlinkIDiOSBinding project and let us know if it works :)

Community
  • 1
  • 1
Dr TJ
  • 3,241
  • 2
  • 35
  • 51