Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by forestjay · Jan 06, 2016 at 08:47 PM · native pluginosxdll errordllimport

How do I include a framework in an OS X native bundle?

I am trying to create a wrapper (bundle) for an OS X framework. In Unity, I'm getting the following error:

  Couldn't open Assets/Affdex/Plugins/affdex-native.bundle/Contents/MacOS/affdex-native, error: dlopen(Assets/Affdex/Plugins/affdex-native.bundle/Contents/MacOS/affdex-native, 2): Library not loaded: affdex-native.framework/Versions/2.1.0./affdex-native
   Referenced from: /Users/foresthandford/git/unity/UnityPlugin/Assets/Affdex/Plugins/affdex-native.bundle/Contents/MacOS/affdex-native
   Reason: image not found

From my searches on this forum, "image not found" often means there is either no binary or an inappropriate binary. The bundle has a universal binary:

 ForestsMacbook:Plugins foresthandford$ file affdex-native.bundle/Contents/MacOS/affdex-native
 affdex-native.bundle/Contents/MacOS/affdex-native: Mach-O universal binary with 2 architectures
 affdex-native.bundle/Contents/MacOS/affdex-native (for architecture x86_64):    Mach-O 64-bit bundle x86_64
 affdex-native.bundle/Contents/MacOS/affdex-native (for architecture i386):    Mach-O bundle i386

The versioning from the framework seems, however, to be incorrect:

 ForestsMacbook:Plugins foresthandford$ otool -L affdex-native.bundle/Contents/MacOS/affdex-native
 affdex-native.bundle/Contents/MacOS/affdex-native:
     affdex-native.framework/Versions/2.1.0./affdex-native (compatibility version 0.0.0, current version 0.0.0)

Currently the framework appears as part of the binary within the bundle. I've heard a suggestion that the framework may need to exist as files separate from the binary (ie: not just compiled into the binary).

  1. Is framework inclusion really the issue?

  2. If it is, how do I fix it?

  3. Does someone have an example XCode project I could look at (I found several OS X plugins in GitHub but none included the .xcodeproj file)?

The closest related question I could find was http://answers.unity3d.com/questions/49150/building-osx-bundles-for-unity-extensions-with-ext.html#comment-1122489 , but it doesn't show how the framework was included. This is my first foray into XCode and I might be missing something obvious.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by forestjay · Feb 03, 2016 at 10:24 PM

This has been resolved. I'm not sure ALL the steps I took were needed.

  • I replaced the framework I was using with a dynamic library. The theory was that because I was using dlopen I should be using a dynamic library.

  • I put the dynamic library inside the bundle at the same location as the binary (affdex-native.bundle/Contents/MacOS)

  • I used 'install_name_tool -id @loader_path/libaffdex-native.dylib libaffdex-native.dylib' to change the path to the dynamic library. Note, this was the most obscure change I made and it took all the Google-fu I had to find it.

Here is a blog post with more details.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I upgraded to Unity 2019.3.7 from 2018.4.0. Firebase cannot found dll. Below is the error which appears on pressing Play button. 0 Answers

Update native plugin without restarting Unity on Mac 1 Answer

MS SQL Database and System.Data dll 2 Answers

EmguCV 'Assets/Plugins/Emgu.CV.UI.dll' will not be loaded due to errors... 0 Answers

Move C# scripts to DLLs targeting UWP/Net deployment: the type or namespace 'SerializeAttribute/Serializable' could not be found? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges