I am trying to build a xamarin component.
I have a created a SomeLibrary.dll from a Binding project.
Using this SomeLibrary.dll and the Component Template(https://components.xamarin.com/guidelines
), I have generated a SomeLibrary-1.0.xam component.
I executed this command to install the SomeLibrary component onto Xamarin Studio(so I can test the component before submitting it to the store):
mono xamarin-component.exe install /Users/somedeveloper/Desktop/XamarinComponent/component-template-master/SomeLibrary-1.0.xam
(recommended by http://forums.xamarin.com/discussion/5640/test-component-packaging)
Now, I am trying to test my SomeLibrary component. I created a brand new project, added the component to my project, wrote a couple of lines that uses SomeLibrary api, and got the following error as I build and run.
I am lost and confused here, any idea, suggestions would be great.^^.
The main thing that I see from the error is:
error MT2002: Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
It seems to be complaining about some sort of PublicKeyToken. What is this? Do I have to generate a PublicKeyToken for my SomeLibrary component? If so, how do I generate a PublicKeyToken.
thanks and appreciate any help, suggestion, or comments !^_^!,
Full Error Log
Building: SomeLibraryComponent (Debug|iPhone)
Detecting signing identity...
Provisioning Profile: XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Signing Identity: "iPhone Developer: XXXXXXXXXX (ALKJLKJSLDKJFLJ)"
App ID: "SDLFJLKSDJF.SomeLibrarycomponent"
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/3.2.3/bin/mcs /noconfig "/r:/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll" -nostdlib "/out:/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.iOS.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG;__MOBILE__;__IOS__" /t:exe "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/Main.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/AppDelegate.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.cs" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.designer.cs"
Compilation succeeded - 1 warning(s)
/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/SomeLibraryComponentViewController.cs(48,24): warning CS0672: Member `SomeLibraryComponent.SomeLibraryComponentViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)' overrides obsolete member `MonoTouch.UIKit.UIViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'. Add the Obsolete attribute to `SomeLibraryComponent.SomeLibraryComponentViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'
/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll (Location of the symbol related to previous warning)
Build complete -- 0 errors, 1 warning
Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign -dev "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Users/somedeveloper/projects/SomeLibraryComponent/Components/SomeLibrary-1.0/lib/ios/SomeLibrary.iOS.dll" -debug -sdk "6.1" -targetver "6.0" --abi=armv7 "-v" "-v" "-v" "--compiler:clang++" "/Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe"
Xamarin.iOS 7.0.1.4 (4cfca2f) Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
Linking assembly /Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/bin/iPhone/Debug/SomeLibraryComponent.exe into /Users/somedeveloper/projects/SomeLibraryComponent/SomeLibraryComponent/obj/iPhone/Debug/mtouch-cache/PreBuild
error MT2002: Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, Mono.Linker.LinkContext& context, System.Collections.Generic.List`1& assemblies) [0x00000] in <filename unknown>:0
at MTouch.LinkAssemblies (System.String main, System.Collections.Generic.List`1& assemblies, System.String output_dir, Mono.Linker.LinkContext& link_context) [0x00000] in <filename unknown>:0
at MonoTouch.Application.ManagedLink () [0x00000] in <filename unknown>:0
at MonoTouch.Application.ProcessAssemblies () [0x00000] in <filename unknown>:0
at MonoTouch.Application.BuildApp () [0x00000] in <filename unknown>:0
at MonoTouch.Application.Build () [0x00000] in <filename unknown>:0
at MTouch.Main2 (System.String[] args) [0x00000] in <filename unknown>:0
at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0
It has nothing do to with public key (tokens).
From the first part of your log it seems that your .dll is named "SomeLibrary.iOS.dll". However the error message is looking for "SomeLibrary", not "SomeLibrary.iOS".
There must be a mismatch between the file name and the internal assembly name.
I got stuck here by copying a project and renaming the project file from Foundation.Mobile to Mobile. I kept on getting a "Component failed to resolve assembly". The answer was to change the actual assembly name in Project Properties.
Uninstall package "SomeLibrary" and install it again via Nuget Package Manager.
I was getting this same error (Failed to resolve assembly: 'SomeLibrary, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'), and that was the solution in my case.
Related
I am trying to run a Xamarin test application on a fresh install of Ubuntu 20.04.2
On a windows 10 machine, I am cloning this repo:
https://github.com/jsuarezruiz/xamarin-forms-gtk-movies-sample
Compile it in Visual Studio 2019, it runs perfectly on android and windows GTK
Then I copy the contents of bin/Debug folder to my Linux machine and try running it with mono, it throws an exception:
Unhandled Exception:
System.DllNotFoundException: libglib-2.0-0.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Movies.GTK.Program.Main (System.String[] args) [0x00043] in <87211febe55c459f869a2b0842e037c3>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libglib-2.0-0.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Movies.GTK.Program.Main (System.String[] args) [0x00043] in <87211febe55c459f869a2b0842e037c3>:0
Obviously missing a "libglib-2.0-0.dll", which I am not sure how to install on Linux and where mono searches for it.
So far I tried installing mono-devel, mono-complete, gtk-sharp2, libglib2.0-dev
After searching through mono logs I noticed that it's trying to access windows-specific dlls, so I tried setting library reference parameter "Copy Local" to false on these libraries:
atk-sharp
gdk-sharp
glade-sharp
glib-sharp
gtk-dotnet
gtk-sharp
pango-sharp
And it worked on ubuntu 18.04.3 LTS
I have searched after a solution to build a windows installer on MacOS with squirrel, but without any luck.
I have successfully installed mono via my terminal.
Version 6.4.0.198.
Versions:
electron: ^4.2.5
electron-builder: ^20.41.0
electron-builder-squirrel-windows: ^20.44.0
I run the command npm run build:win, after a bit of packaging this error comes up
Error: Exit code: 255. Command failed: mono /Users/admin/Library/Caches/electron-builder/Squirrel.Windows/Squirrel.Windows-1.9.0/Update-Mono.exe --releasify /Users/admin/Desktop/myTestBuild/dist/squirrel-windows/mytestbuild-1.0.0-full.nupkg --releaseDir /Users/admin/Desktop/myTestBuild/dist/squirrel-windows
2019-10-05 18:55:36> Unhandled exception: System.ComponentModel.DataAnnotations.ValidationException: Description is required.
at NuGet.Manifest.Validate (NuGet.Manifest manifest) [0x000b1] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.Manifest.ReadFrom (System.IO.Stream stream, NuGet.IPropertyProvider propertyProvider, System.Boolean validateSchema) [0x0007b] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.Manifest.ReadFrom (System.IO.Stream stream, System.Boolean validateSchema) [0x00006] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.LocalPackage.ReadManifest (System.IO.Stream manifestStream) [0x00000] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.ZipPackage.EnsureManifest () [0x00050] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.ZipPackage..ctor (System.String filePath, System.Boolean enableCaching) [0x00049] in <64ead1da9ab54e29ae45ecd50faea709>:0
at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <64ead1da9ab54e29ae45ecd50faea709>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x0000d] in <64ead1da9ab54e29ae45ecd50faea709>:0
Hope someone can help me, have a great day.
Finally found a solution!
your "description" in package.json cannot be empty. That is why it says
Description is required. at NuGet.Manifest.Validate........
This should definitely be added to docs of electron-builder and/or electron-builder-squirrel-windows.
i had download the Emgucv for Raspberry Pi 2 and in that there some sample projects when iam trying to run the application using this cmd
mono /home/pi/Downloads/libEmgu/usr/bin/Example.HelloWorld.monoexe
iam getting an exception
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke ---> System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.Util.Platform ---> System.DllNotFoundException: c
at (wrapper managed-to-native) Emgu.Util.Platform:uname (intptr)
at Emgu.Util.Platform..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.GetModuleFormatString () [0x00000] in <filename unknown>:0
at Emgu.CV.CvInvoke..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at HelloWorld.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke ---> System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.Util.Platform ---> System.DllNotFoundException: c
at (wrapper managed-to-native) Emgu.Util.Platform:uname (intptr)
at Emgu.Util.Platform..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.GetModuleFormatString () [0x00000] in <filename unknown>:0
at Emgu.CV.CvInvoke..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at HelloWorld.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
can any one help to guide how to run application using opencv.
System.DllNotFoundException:
The Emgu CV native library is not begin found:
System.TypeInitializationException: An exception was thrown by the
type initializer for Emgu.CV.CvInvoke --->
System.TypeInitializationException: An exception was thrown by the
type initializer for Emgu.Util.Platform --->
System.DllNotFoundException:
After you have installed & compiled Emgv CV (not just the C# wrapper code, but also the CPP code), on Linux you need to tell the Mono runtime where it can find the native libraries (EVEN if they are in the same directory as the C# assemblies):
Running the Examples
cd bin
In your case:
cd /home/pi/Downloads/libEmgu/usr/bin/
Assign the dynamic library path:
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
Run the example within the bin dir:
mono Example.HelloWorld.monoexe
Reference the following link for more details: http://www.emgu.com/wiki/index.php/Download_And_Installation#Build_the_binary
I have been trying to get Mono and the apache module running without success. when I try to run mod-mono-server4 from the command line i get a FileNotFoundException:
The actual error is:
slackKingServer:/# mod-mono-server4
Handling exception type FileNotFoundException
Message is Could not load file or assembly 'mod-mono-server4, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
IsTerminating is set to True
Could not load file or assembly 'mod-mono-server4, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
at (wrapper xdomain-invoke) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in <filename unknown>:0
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in <filename unknown>:0
at Mono.WebServer.Apache.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean v_quiet) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.WebServer.Apache.Server:RealMain (string[],bool,Mono.WebServer.IApplicationHost,bool)
at Mono.WebServer.Apache.Server.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'mod-mono-server4, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
File name: 'mod-mono-server4, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
at (wrapper xdomain-invoke) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in <filename unknown>:0
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in <filename unknown>:0
at Mono.WebServer.Apache.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean v_quiet) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.WebServer.Apache.Server:RealMain (string[],bool,Mono.WebServer.IApplicationHost,bool)
at Mono.WebServer.Apache.Server.Main (System.String[] args) [0x00000] in <filename unknown>:0
I know it is saying it can't load mod-mono-server4, but I am not sure where it is looking at for the file.
Any assistance is greatly appreciated.
If anyone else is getting the above error. I fixed by doing the following. Now keep in mind I built everything from source in a Slackware 14.1 environment.
I had to copy the content of the xsp gac directory to the mono gac directory.
I ran diff -r /xsp/gac /mono/gac
then copied the files that were missing ton the mono GAC directory
Now,I have updated my Xamarin.ios to 7.0.x It is giving error that, I am already having xcode 5
Error: A valid Xcode installation could not be found. If your copy of Xcode is
installed to a non-standard prefix, please specify the location in MonoDevelop's
Preferences under 'SDK Locations'. (Scrapboom.iPhone)
I have updated Xcode to 5.0 for ios7 and running application in monodevelop but application is not running it is giving,
warning on simulator:
warning MT1201: Could not load the simulator: dlopen(Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient, 1): image not found
warning on device:
warning MT1003: Could not kill the application 'com.scrapboom.iphone'. You may have to kill the application manually.
error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.IO.DirectoryNotFoundException: Directory 'Platforms/iPhoneOS.platform/DeviceSupport' not found.
at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetDirectories (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
at MonoTouch.Installation.Device.get_DeveloperImagePath () [0x00000] in <filename unknown>:0
at MonoTouch.Installation.Device.MountDeveloperImage () [0x00000] in <filename unknown>:0
at MonoTouch.Installation.Installer.FindApplication (MonoTouch.Installation.Device d, System.String appId) [0x00000] in <filename unknown>:0
at MonoTouch.Installation.Installer+<LaunchApplication>c__AnonStorey1A.<>m__22 (MonoTouch.Installation.Device d) [0x00000] in <filename unknown>:0
You can set the new XCode location in Xamarin.Studio in the Preferences:
Xamarin Studio > Preferences... > Projects > SDK Locations > Apple
If you don't have the green check marks, set the location targetting your new XCode 5 installation (usually /Applications/XCode.App)
I had a similar issue after updating to Xcode6. What helped me was installing all updates for Xamarin Studio over the beta channel. Go to Xamarin Studio > Check for Updates ... an then choose beta instead of stable