-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Xamarin C# Support #33040
Comments
See #20267 (comment) for a response from the founder of Mono and Xamarin. Any development tools we implement have to be multiplatform, since Godot is multiplatform, and it's Microsoft's business decision to not release Xamarin development tools for Linux. Stated indirectly:
But anyway, thanks for opening this issue, we had nothing to track it before, even if it's looking quite hopeless to do in the near future. |
@aaronfranke Thank you for the research, now that I think about it, I remember following you down this same rabbit hole (Only to learn that Evil Empires rarely change their minds about their enemies). Well now I am going to look for a workaround. I tried wine, but failed to get visual studio to install, now trying to get a virtual machine to install everything, but seems godot may not run in a virtual machine. So may be a dead end for Linux Developers? |
@FeralBytes I don't understand what you're tying to achieve, Why do you want Xamarin support and why do you need Visual Studio on linux? I've been working with .NET and Godot for a while on linux and I don't have those problems. VSCode works like a charm on Linux for .NET and Godot uses mono for C#. |
@ricardoalcantara I want to develop Android apps on Linux using C# which requires Xamarin for Android support. using Android; But I can not because Microsoft has purposefully blocked the use of Xamarin on Linux, you have to use it on Windows. |
@FeralBytes You don't need Xamarin to make an Android App on Linux with Godot, have you read the documentation? Godot's C# implementation for Android uses Mono. #29359 |
@ricardoalcantara How can I use android specific features, for instance I want to turn wifi on and off, not event considering Android 10 which has a special requirement for such operations. Or Say I want to create a service on Android? Or utilize Bluetooth? Can I do these without Xamarin? If we can thoose should be published somewheres for the community to use. It is definitely possible to code around and basicly re-implement Xamarain's features but we really should not have too. |
You can do it but you have to do it natively with java, you have to create an android module and setup an interface using Godot APIs and after that you can call it with C#, you can even use android specific dependencies like admob or firebase, actually this is how we do that. http://docs.godotengine.org/en/latest/tutorials/plugins/android/android_plugin.html [Edit] |
@ricardoalcantara Yes I know I could write Java, as that is what I did when I wrote the new permissions for Godot, but I want something easier. That required a large amount of setup, and maintanence. C# is integrated, having access to Xamarin would complete the package with out the need of recompiling the entire engine every time. |
@FeralBytes They choose not to use Xamarin, there is no Xamarin available to be used. [Edit] |
Actually Xamarin is still a part of the C# ecosystem. But as stated by the microsoft emplyees, they could get it working for Linux, but they are not going to. So yes there is no Xamarin for Mono, but their is Xamarin for Visual Studio. Not to be confused with Code (Visual Studio Code). You can see the difference between thoose products here. |
I know those products, I know Xamarin since before Microsoft purchased it, I know Visual studio since the first one and VSCode too, I know the difference, I know .NET Core (which runs on linux natively), .NET framework and .NET Standards, I know Mono project, I know the moves Microsoft made to make .NET Core, .NET Framework and Mono to have the same code base, I don't have doubts I am trying to solve yours, maybe you don't know Godot enough... and I also know that there is no Xamarin for Godot. What else do you need? |
Xamarin for Godot. Not trying to be rude, but that is the title, technically it isn't, but it is an issue opened for the Godot Engine with a title of Xamarin C# Support. Additionally my first post does ask pretty clearly what I would like.
This is a confusing statement.
It seems like you are just trying to insult me now. So I think I will stop having this conversation with you. |
Now I understand, you want to request a feature. This what I asked at the first place. For me your issue is not clear, you opened it as Xamarin was implemented and requesting sample projects. For this issue you better open it here https://github.com/godotengine/godot-proposals
Not at all. |
In case there is still any confusion as to why it would be desired to have Xamarin available with Godot, let me just copy paste this bit from Miguel de Icaza's comment:
Edit:
Xamarin is built on top of Mono. |
For me until C# has Xamarin, this new Java plug-in system is the way forward for me. It makes Java plug-ins much faster to create and modify then ever before. |
To work around not having Xarmarin, would it be possible to make a generic Java plugin that does everything that's needed? I absolutely need to read and write external storage from C# for my project to remake Wolfenstein 3-D for the Oculus Quest. And I really do mean external storage, not the app's private storage and not resources bundled into the APK. |
Godot's Android build templates already won't build on Windows, only on Linux. So Godot isn't really multi-platform: it's really Linux-first. |
Yes, you can do it in Java and interface with Godot using C# or GDScript (there's other ways too).
I achieve to build Android template on windows and Linux. It just not straightforward, but obliviously it's easier on Linux, windows has many issues that you have to workaround =/. But I agree it's Linux first, because they use Linux and they love FOSS, but the community maintain the other OS compatible as well. Even the Vulkan branch that's been developed on Linux Ubuntu, has other contributors committing to adjust for Windows and MacOS. Anyway tell us more about your issue building on windows and if it is a bug you can even open an issue for that, providing more information about Version, OS, Logs and soon on. Saying it doesn't build isn't very helpful. |
Oh, I'm sorry, I forgot to mention that the problem there is with Mono. AFAIK, Mono doesn't build on Windows, only on Linux. You can build the regular Android build templates without C# support on Windows, but not the Godot Mono Android build templates. I know C#, Java and a little C++. But I'm completely lost on how to make this Java plugin. I know how to ask for the permission to read external storage I need in a Java Android app, but not how to make it into a plugin for Godot and make that accessible from C#. I'm not sure how to even start researching that. |
Isn't being able to make calls to the Android API inherently part of what "Android support" means? I mean Godot couldn't even run on Android without being able to make Android API calls. However it is doing that should be exposed by default. I'm really confused as to why this would need a plugin when all the plugin's going to do is expose the API that should already be exposed. |
@BenMcLean because in short Godot is really a Native C & C++ application, it has just enough Java integrated into it, to talk to Android for only exactly what it needs, this is done as a API between the Native C++ Godot Engine and a Java Program that supports that API, carrying out the required functions for the Engine. The same thing would have to be created in C# for Android... but my argument is that it already exists, it is called Xamarin and to use that in C# you just call |
After reading this, it looks like I would need some major hand-holding from someone who's done it before to make and debug any Godot Java plugin if it was ever going to happen, and I don't think anyone's going to want to take the time for that. Let me know if anyone's interested to help me out. I think that, if I'm on my own, then I can get my app running in Unity faster than I could figure this out. |
If anyone else comes along and wants to know how to get access to external files on Android, here's how it's done on the Java side. |
I can't say for certain what will be of this, but just a clarification: The reason this is not done right now is not because of any block by Microsoft. Xamarin Android, albeit not officially supported, can be made to work on Linux and, as Miguel commented, they can produce packages for Godot to use. |
I'm not experienced with Xamarin Android, but I would be happy to make this happen. The reason it hasn't happened yet is simply because I have several higher priority tasks. |
All I actually needed for my project was to request external file permissions so that the popup for it would appear, and "SomeBody3D" on Discord pointed out that this got merged 20 days ago. That exposes what I needed! Having Xamarin would be nice for other people trying to achieve other things, but to be able to access external file storage, you just need to:
I still need to figure out how to query that the permission was granted so that my program won't try to dig into the files too early, before it actually has permission, (because program execution does not halt to wait for the permission) but this is definitely progress and shows I probably won't need to make a Java plugin for this after all. Trying to make a plugin just for that would have been crazy! |
Recently I could build a Xamarin.Android application in my Linux machine, as described is this issue. |
@knuxbbs I will have to try this out soon. Thanks! |
Wondering if this could help: https://dev.azure.com/xamarin/public/_build/results?buildId=31493&view=results |
We will have to wait for .NET 6 to figure out what to do about this. It will not only be about the benefits of Xamarin.Android (like the Java/Android bindings) but also whether the way Godot does it right now is still viable with .NET 6. |
@neikeq https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-1/ "We’re integrating the Android, iOS, and macOS capabilities that are part of Xamarin into .NET 6" |
See godotengine/godot-proposals#2333 for possible (not yet decided) future changes that have some relation with this. |
So... would it not make more sense to replace the Mono implementation of C# with .NET 6 in Godot? |
@aspenforest .NET 6 is not out yet. For when it is out, read the proposal linked directly above your comment for plans. Unfortunately, the Godot developers do not own any time machines. 😛 |
Speaking of things the Godot developers sadly do not have, they also do not have a grant from Microsoft to continue major C# development of the Godot engine, correct? I am sort of looking into my crystal ball to see the future by knowledge of what happened in the past. In the past, it required a large grant from Microsoft to make Godot Mono happen in the first place and since I think it would likely be a project similar in size to get away from Mono onto .NET 6, it is unlikely that Godot .NET 6 will happen unless there's a new grant for that. Or am I wrong? Please support Godot, Microsoft! Godot Mono was great and the grant that made it possible was money well spent IMO! |
I have read this issue in its entirety but I still do not understand what this request wants ! |
@ALipAkrohk I built a checklist of items? If the primary stakeholders of the engine wish to close this issue they always can. In the end I wrote my own Kotlin plugins for Android and will write something for iOS if I ever ship on iPhone. C# simply is not feasible at this time and that is why the issue highlights, the new issues with .NET6 just highlights it, same as no funding from Microsoft. At this point I don't intend to touch C#, because it is still broke, unless someone can point me at things that can check off the items above. |
This comment has been minimized.
This comment has been minimized.
If Godot Mono was to be discontinued without a clear upgrade path to more C# development on Godot, then I'd be switching game engines for my next project to something that does C#. I might be doing that anyway, but this would make it for sure. When coding games, I want to be able to use the same real programming tools I get to use in my job writing business software: not have to completely switch languages. |
There are two options in your content. |
I have to remind you, that this issues section is not a discussion forum. It's a place to report and track bugs and issues in the engine. To discuss the future of C# in Godot you can, appropriately, use the aforementioned proposal godotengine/godot-proposals#2333. In fact, this issue itself has been previously redirected to the proposal repository by @neikeq:
So if Xamarin support is required for some mobile development use cases, please open a formal proposal for the missing features. As it stands, Godot Mono fully supports mobile platforms, even if you have to write platform-specific code for some platform-specific functionality in another language. |
I wanted to open an issue specific to tracking the status of using Xamarin with Godot. Because I have no idea how to do it, or if it is even possible yet?
I imagine this already works for Windows users, but given that many of us are Linux users; to include many Godot core developers; I wanted to know how we use it too.
Things needed to close this issue:
Applies to Godot current master, and 3.2a2.
Thank you to all of the developers for your time and for making Godot such an awesome engine. I do realize that solving these issues is non-trivial, but if they are solved I wanted to know how? If they are not solved, I would like to know what are the possibilities for ways to solve it, and how can the community help?
The text was updated successfully, but these errors were encountered: