Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not detect platform. Are you missing a platform assembly? Mac #1427

Closed
DavinciCodes15 opened this issue Jun 5, 2019 · 3 comments
Closed

Comments

@DavinciCodes15
Copy link

So I decided to try out your product and just did a simple default application meaning I selected New project gave it a name "CrossPlatformTest" and compiled it.
NOTE:
I selected Single Windows, Linux, and Mac Desktop project
also Code Preview.

Expected Behavior

It worked well in Windows and I expected the app to work on Mac as well as windows.

Actual Behavior

I copied the CrossPlatformTest.Desktop.app folder to mack and double-clicking it shows an error "The application CrossPlatformTest.Desktop cant't be opened." going to the terminal and running it from the command line shows a different error.

mono CrossPlatformTest.Desktop.exe

Unhandled Exception:
System.InvalidOperationException: Could not detect platform. Are you missing a platform assembly?
at Eto.Platform.get_Detect () [0x000d5] in <6db481985cca4510b36c8dbd12852b82>:0
at CrossPlatformTest.Desktop.Program.Main (System.String[] args) [0x00001] in <4c2f9d36573149108fc8387650940704>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Could not detect platform. Are you missing a platform assembly?
at Eto.Platform.get_Detect () [0x000d5] in <6db481985cca4510b36c8dbd12852b82>:0
at CrossPlatformTest.Desktop.Program.Main (System.String[] args) [0x00001] in <4c2f9d36573149108fc8387650940704>:0

Specifications

  • Version: 2.4.1
  • Platform(s): Mac
  • Operating System(s): macOS 10.13.6
  • Visual Studio 2017 v15.9.1
  • Mono JIT compiler version 5.18.1.3

Others have seen this issue but there is no clear resolution as to what I need to do.
#29

@cwensley
Copy link
Member

cwensley commented Jun 5, 2019

Hey @DavinciCodes15, thanks for reporting the issue. Fortunately, it's probably a simple solution. I think the problem stems from this:

I copied the CrossPlatformTest.Desktop.app folder

Simply copying the folder over to Mac does not set up the executable permissions of the application. After you have copied the .app bundle, you need to do something like this:

chmod +x CrossPlatformTest.Desktop.app/Contents/MacOS/CrossPlatformTest.Desktop

Another way to copy it over is to .zip the .app bundle up, then unzip it on macOS. macOS will properly set the executable bit when extracting the .zip file.

Also, to run an .app bundle you cannot use mono at the command line to run it, you must execute the above executable to launch the application using MonoMac or Xamarin.Mac, or use open. E.g. from Terminal:

./CrossPlatformTest.Desktop.app/Contents/MacOS/CrossPlatformTest.Desktop

I'll add these instructions to the troubleshooting guide on the wiki.

@DavinciCodes15
Copy link
Author

DavinciCodes15 commented Jun 5, 2019

That did not work however the Icon changed from a cross over it to the default icon you provide. However double-clicking it did not work nor running it from the command line.

I did not zip it up I did a direct copy BTW and changing it to runnable is not the issue it would appear that libs are missing.

Here is a list of files found in the directory

AtkSharp.dll System.Linq.Parallel.dll
CairoSharp.dll System.Linq.Queryable.dll
CrossPlatformTest.Desktop.exe System.Linq.dll
CrossPlatformTest.Desktop.exe.config System.Net.Http.dll
CrossPlatformTest.Desktop.pdb System.Net.NameResolution.dll
CrossPlatformTest.dll System.Net.NetworkInformation.dll
CrossPlatformTest.pdb System.Net.Ping.dll
Eto.Gtk.dll System.Net.Primitives.dll
Eto.Mac64.dll System.Net.Requests.dll
Eto.Wpf.dll System.Net.Security.dll
Eto.dll System.Net.Sockets.dll
GLibSharp.dll System.Net.WebHeaderCollection.dll
GdkSharp.dll System.Net.WebSockets.Client.dll
GioSharp.dll System.Net.WebSockets.dll
GtkSharp.dll System.ObjectModel.dll
Info.plist System.Reflection.Extensions.dll
MacIcon.icns System.Reflection.Primitives.dll
Microsoft.Win32.Primitives.dll System.Reflection.dll
MonoMac.dll System.Resources.Reader.dll
PangoSharp.dll System.Resources.ResourceManager.dll
RevDeBug.setup System.Resources.Writer.dll
System.AppContext.dll System.Runtime.CompilerServices.VisualC.dll
System.Collections.Concurrent.dll System.Runtime.Extensions.dll
System.Collections.NonGeneric.dll System.Runtime.Handles.dll
System.Collections.Specialized.dll System.Runtime.InteropServices.RuntimeInformation.dll
System.Collections.dll System.Runtime.InteropServices.dll
System.ComponentModel.EventBasedAsync.dll System.Runtime.Numerics.dll
System.ComponentModel.Primitives.dll System.Runtime.Serialization.Formatters.dll
System.ComponentModel.TypeConverter.dll System.Runtime.Serialization.Json.dll
System.ComponentModel.dll System.Runtime.Serialization.Primitives.dll
System.Console.dll System.Runtime.Serialization.Xml.dll
System.Data.Common.dll System.Runtime.dll
System.Diagnostics.Contracts.dll System.Security.Claims.dll
System.Diagnostics.Debug.dll System.Security.Cryptography.Algorithms.dll
System.Diagnostics.DiagnosticSource.dll System.Security.Cryptography.Csp.dll
System.Diagnostics.FileVersionInfo.dll System.Security.Cryptography.Encoding.dll
System.Diagnostics.Process.dll System.Security.Cryptography.Primitives.dll
System.Diagnostics.StackTrace.dll System.Security.Cryptography.X509Certificates.dll
System.Diagnostics.TextWriterTraceListener.dll System.Security.Principal.dll
System.Diagnostics.Tools.dll System.Security.SecureString.dll
System.Diagnostics.TraceSource.dll System.Text.Encoding.Extensions.dll
System.Diagnostics.Tracing.dll System.Text.Encoding.dll
System.Drawing.Primitives.dll System.Text.RegularExpressions.dll
System.Dynamic.Runtime.dll System.Threading.Overlapped.dll
System.Globalization.Calendars.dll System.Threading.Tasks.Parallel.dll
System.Globalization.Extensions.dll System.Threading.Tasks.dll
System.Globalization.dll System.Threading.Thread.dll
System.IO.Compression.ZipFile.dll System.Threading.ThreadPool.dll
System.IO.Compression.dll System.Threading.Timer.dll
System.IO.FileSystem.DriveInfo.dll System.Threading.dll
System.IO.FileSystem.Primitives.dll System.ValueTuple.dll
System.IO.FileSystem.Watcher.dll System.Xml.ReaderWriter.dll
System.IO.FileSystem.dll System.Xml.XDocument.dll
System.IO.IsolatedStorage.dll System.Xml.XPath.XDocument.dll
System.IO.MemoryMappedFiles.dll System.Xml.XPath.dll
System.IO.Pipes.dll System.Xml.XmlDocument.dll
System.IO.UnmanagedMemoryStream.dll System.Xml.XmlSerializer.dll
System.IO.dll netstandard.dll
System.Linq.Expressions.dll

@DavinciCodes15
Copy link
Author

Hold the barn I got it to work.
I did not see the I needed to change the folder in the subfolder to executable.
Thanks this is the first time I have seen a mono project run with a visible form on any platform except windows!

Thanks close the case.

@cwensley cwensley closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants