Native plugin with Unity3d Mac OSX Dll notfoundexception - macos

I am trying to integrate a 3rd party native plugin with unity3D. In order to use it i made a c# plugin as a wrapper dll. The plugin works fine with PC standalone when i copy the plugin binaries manually to build folder along with my EXE file.I have used debug configuration for the plugin build process.
Problem is :
when i make a mac OS X build, i am getting DllNotFoundException. My c# plugin file is in the app located at "\Contents\Data\Managed" along with other unity related plugins which means unity is recognizing my wrapper plugin but not copying the native plugins.
Things already tried :
I copied the native plugins also in the Assets/Plugins/ folder so as they are also included in build, but unity didn't include them in build.
I tried putting my native plugin in "\Contents\Data\Managed" folder and also in other folders in the app,still it was not able to find the dll.
I tried putting the dylib file which came with the native plugin, also along with my wrapper plugin but it didn't work.
I tried to do a dllmap in the config file at "\Contents\Data\Managed\etc\mono" using
also, but it didn't work.
I am out of ideas. Any help is appreciated.

It worked for me to add a dll map to the mono config file found here:
Your.app/Contents/Data/Managed/etc/mono/config
I added the following :
<dllmap dll="phidget21.dll" target="/Library/Frameworks/Phidget21.framework/Versions/Current/Phidget21" />
Make sure that the Phidget21.framework exists in /Library/Frameworks..

Related

Building a React Native bridge but a file within the framework can't be found

I'm trying to build a React Native wrapper for the RichRelevance iOS SDK.
I've created the wrapper project and imported it into my React Native app. I'm using Cocoapods to add the RichRelevance SDK to the app
I'm now attempting to import the RichRelevance SDK into the wrapper project using:
#import <RichRelevanceSDK/RichRelevanceSDK.h>
The problem I have is that when the compiler attempts to compile the RichRelevanceSDK, it throws an error that one of the files is not found:
Line 63 is the original import that was written in the SDK. I added Line 62 to show that the file can be found if the type of import is changed. However, this isn't really an option since I don't want to modify the SDK (I don't own it).
In either type of import, I'm able to cmd+click the file and go to the definition. So XCode seems to know about the file. Additionally, I see the file in the Project browser under:
Pods -> Pods -> RichRelevanceSDK -> RCHImportable.h
The primary difference with this file is that, if I look in the file browser, that file is located in a sub-folder, relative to all of the other files in the SDK:
I'm hoping there's a way to change my wrapper project so that this file can be found, so I don't have to edit or fork the SDK files.
So far, I've attempted to update the various Search Paths in my wrapper project but with no luck. I've added the following two paths to all of the Search Paths:
UPDATE:
I was able to make some progress and I can now get it to compile.
I ended up:
cloning the SDK's repo to my computer
removing the SDK from the Podfile
adding the SDK's xcodeproj file to MyApp/Libraries
adding the SDK.framework file to MyApp -> Embedded Binaries
I can now import the SDK into my bridge module
I would still prefer to find a better way to do this though. This method either involves me committing the SDK to our repo or asking all of my colleagues to clone the repo to their machine. NPM can't seem to install the repo; my guess is this is due to the repo missing a package.json file
There does appear to be something wrong with the packaging, as the header in question would appear to be captured in the public_header_files glob in the Podspec.
However, I think more direct path is to simply include the RCHSDK.h file, as RCHSDK is the entrypoint to the SDK functions. The RichRelevanceSDK.h serves primarily as a shorthand for importing additional headers versus specifying them individually.
Alternatively, you can follow the instructions in Include of non-modular header inside framework module, this seemed to correct the issue in local tests.

Bamboo unable to find framework corresponding to the target framework moniker?

I am trying to implement Bamboo into creating an IPA file or APK file using Xbuild but I am getting 1 warning and 1 error:
The warning is the following:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: warning : Unable to find framework corresponding to the target framework moniker '.NETPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.
The error is this:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : PCL Reference Assemblies not installed.
I am unsure why this is happening because when I open the project in Xamarin studio and build it, it will be successful, and when I run it the app is fully functional with no problems at all. I have located the file location of the profile 78 in the version 4.5 and it exists, I have the latest installed version of Mono Development Kit (MDK). How can it build correctly in Xamarin but not in Bamboo, is it do with how I locate the files?
I have also tried to create the APK file on the terminal but got the same error as well. I have tried a lot of fixes like uninstalling mono and reinstalling, I added .NETPortable from windows to Mac but that didn't work, why can't my mac find the profile 78 it is located on my mac.
The file /usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/microsoft.common.targets seems to be looking for the .NetPortable,Version=v4.5,Profile=78 but I have that in this location: Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/xbuild.frameworks/.NetPortable/v4.5/Profile/Profile78 and I have pasted the .NetPortable folder in multiple locations to try and fix this error. Where am I going wrong?
Although I have not touched Bamboo for quite some time(3+ years), one thing I personally do is to ensure your xbuild command works like a charm in a local environment with a similar setup. Seeing that you tried to create an .apk through the terminal and got the same error sounds like an installation error. The PCL Reference Assemblies should be apart of the MDK on MacOS. Seeing that you have it installed, it sounds like a potential issue with file permissions of the Bamboo user account.
To create an .apk file, you need to use the /t:PackageForAndroid target against your Android project when invoking xbuild.
EX:
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:PackageForAndroid
You can also use the SignAndroidPackage target given the notes here:
https://developer.xamarin.com/guides/android/under_the_hood/build_process/#Build_Targets
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:SignAndroidPackage
If you wanted to use the MSBuild equivalents, it would look like this:
msbuild MyAndroidApp.sln
msbuild /t:SignAndroidPackage MyAndroidApp.csproj

Xbuild can't recognize SignAndroidPackage when using bamboo

I am trying to create a .APK file in Bamboo using the xbuild executable in a command task. The way I thought it should work is like this:
CusomterApp.sln /t:SignAndroidPackage /p:Configuration=Release
This however when I run the build will give this error. Target named 'SignAndroidPackage' not found in the project. I have tried to build it without it but I am getting other errors instead. I have tried changing the order of it and changing the target but it doesn't seem to create the apk file doing this.
I have seen in another question that someone created an apk file using this(not on Bamboo):
xbuild $ANDROID_PROJECT_FILE /t:SignAndroidPackage /p:Configuration=Release
So I thought I should have no problems with using this on Bamboo but the executable doesn't seem to recognize the SignAndroidPackage and doesn't work, any ideas on how to fix this?
I create a .IPA file for an IPhone app using mdtool, with this command -v build -t:Build "c:Release|iPhone" CustomerApp.sln and this works fine for creating the .IPA file so I would have thought that the .APK would be fine too.
I think that the problem is to do with using the solution file for the Android apk file, The bamboo will create a solution folder which has both iOS and Android files in it. The iOS worked and built the IPA file when I used the CustomerApp.sln file. The apk file does not build when I use the CustomerApp.sln. If I use this CustomerApp.Droid/CustomerApp.Droid.csproj file I get a list of error's Are you missing an assembly reference?
When I was doing the IPA I got this error using the CustomerApp.iOS/CustomerApp.iOS.csproj file which I fixed by using the CustomerApp.sln file instead. How can I fix this as the whole folder contains information that is necessary for the creation of the APK file?
I have found a problem that when I try to build the apk file using this: /p:Configuration=Release CustomerApp.sln it gives me the error PCL assemblies not installed and it also has this warning : Unable to find framework corresponding to the target moniker '.NetPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behaviour. I don't know why this is happening as I looked for the profile in the folder specified and it was there.
I had this problem before when trying to use xbuild to create the IPA file but then I used mdtool and it worked fine, I think I need to use xbuild to build the apk file but I can't see how to fix it. I also tried to run it in the terminal of the mac and I got the same error. Why is this happening?
The reason this happens is because you have to specify a .csproj, not a .sln. If you give it a solution file, you'll get an error complaining that it can't find the "SignAndroidPackage" target.

Could not find or load qt plugin windows

After having enough in searching and reading peoples questions that had the same problem as i have and trying allot of solutions that doesn't seems to help, I'm posting my question.
I want to run my project- qt application, it ran well when i built it on qt4.8.1 32bit and 5.1.1 64bit. now i want to run it on qt5.3.0 32 bit. i installed qt open source with the following configuration:
qt 5.3.0 msvc2010_opengl 32bit.
Since my projects is using qt solutions- qt single application and qt service, i downloaded the packeges, built it in the new environment and placed them in qt/qt5.3.0/5.3/bin and qt/qt5.3.0/5.3/lib.
(I mention this last detail because a simpler qt project that doesn't use these dlls- service and single application runs well in my environment).
Well, when I run my application from qt it doesn't run. When i run the exe file from the release folder i get the following error:
This application failed to start because it could not find or load the qt platform plugin "windows". reinstalling the application may fix this problem.
I tried all creative ideas:
note: I see that automatically the build arainged the release folder with the folowing struck:
plugin folder with all plugins in it.
platform folder with the hole list of platforms: qwindows.dll, qminimal.dll...
and also put straightly the dlls: qwindows.dll, qwindowsd.dll
libEGL.dll
libEGLd.dll
qt.conf with the data:
[Paths]
Plugins=C:...\build-____-Desktop_Qt_5_3_0_MSVC2010_OpenGL_32bit-Release\release\plugins
I used the dependency walker that told me that the IEShims.dll is missind, so I brought it to the release folder from: C:\Program Files (x86)\Internet Explorer.
Now the dependency walker tells me:
Warning: At least one module has an unresolved import due to a
missing export function in a delay-load dependent module.
I see that the Qt5core.dll->link checksum member in the dependency is marked with red, and also I see it takes it from:
C:\Qt\Qt5.3.0\Tools\QtCreator\bin
so I bring to the release folder the Qt5Core.dll from:
C:\Qt\Qt5.3.0\5.3\msvc2010_opengl\bin. then I get the following message:
the procedure entry point
?bytearrayToDouble#QLocalePrivate##SANPBDPA_N1#Z could not be located
in the dynamic link library
c:/Qt/Qt5.3.0/Tools/QtCreator/bin/Qt5Gui.dll
so maybe its wrong to do so.
what else can i do???

Macdeployqt doesn't include Phonon in the .app bundle

Hello fellow programmers!
I have written a video player using Qt. Everything works fine on my Mac, but when I use macdeployqt to deploy my application and I open the result, I am getting the following message:
WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded
WARNING: Phonon::createPath: Cannot connect Phonon::MediaObject ( no objectName ) to Phonon::AudioOutput ( no objectName ).
WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded
...
And of course it doesn't play audio (in my machine or in another). Maqcdeployqt does include the other parts of Qt and the 3 party libs wo problems. Its just the damm Phonon.
I feel that i'm making a dumb mistake but i just cant find it.
The otool log of my app shows:
#executable_path/../Frameworks/phonon.framework/Versions/4/phonon (compatibility version 4.4.0, current version 4.4.0)
As the only reference of phonon.
I read in the documentation of qt the following:
"The Mac deployment tool can be found in QTDIR/bin/macdeployqt. It is designed to automate the process of creating a deployable application bundle that contains the Qt libraries as private frameworks.
The mac deployment tool also deploys the Qt plugins, according to the following rules:
-Debug versions of the plugins are not deployed.
-The designer plugins are not deployed.
-The Image format plugins are always deployed.
-SQL driver plugins are deployed if the application uses the QtSql module.
-Script plugins are deployed if the application uses the QtScript module.
-The svg icon plugin is deployed if the application uses the QtSvg module.
-The accessibility plugin is always deployed. "
Maybe i have a debug version of phonon? I don't know, i have tried to deploy the debug and the release versions and none have worked.
Also i founded a related problem in this page:
http://www.justinfx.com/tag/phonon/
So i included a folder named 'PlugIns' in my bundle with the phonon_backened folder from my system inside of it after the deploy: it played audio on my machine (but it didn't play it on another) and my app crashed at the end so that cant be the way.
I'm using c++, Qt 4.8.5, the phonon from the SDK (i didn't install any version of phonon, i just installed Qt), and Mac OS X (10.6.8)
I would love to hear any idea or suggestion.
Thanks in advance.
I didn't find the source of the error, but I bypassed it by macdeploying the phonon example from the qt examples folder on another Mac (i.e. Lion). It included the folder 'Plugins' inside the bundle with all the phonon stuff, so I include now that folder into the bundles macdeployed in my Snow Leopard manually. It is ugly but it works from now.
If anyone knows the way to really fix the issue I will be happy to hear it.
I used py2app (neither pyinstaller nor cx_freeze worked) and it created the app distribution folder almost perfectly, except it did not copy the phonon backends. Running macdeplpyqt did not help.
The location of your plugins in your app structure is MyApp.app/Contents/PlugIns so I copied over the folder from Qt install (/Developer/Applications/Qt/plugins/phonon_backend/ ) into the PlugIns folder. That still gave the same error.
Digging in further I saw that MyApp.app/Contents/Resource/qt.conf file is expecting the plugins to be in the Resource/qt_plugins folder so I made a symbolic link from from PlugIns MyApp.app/Contents/PlugIns to MyApp.app/Contents/Resource/qt_plugins and everything works now.

Resources