Xamarin Continuously Breaks with Multiple Different Errors - c#

Okay so I wanted to get into mobile development and decided to start with Android Studio, but I wanted to more easily reach both Android and IOS so switched over to Xamarin.
Honestly, Xamarin looks really cool and I have been trying so hard to get into it, but every time I open a new Xamarin project it seems to break right away before I really get to do anything.
Sometimes it asks me to update something so I do so before I begin development and it breaks, sometimes I run an initial build right when I make the project with no changes made and it breaks. Sometimes I do something as simple as adding a button or entry in the XAML code and it just breaks, and when I erase all my changes it is still broken.
I just want to know, is this just me or is this just how Xamarin is? I know there is a huge chance it is just me having no idea what I'm doing, but the project seems to break even when I follow updated tutorials and documentation. I have gotten errors even involving the file path it made.
Summary
The short time I used Android Studio I was able to get decently far into development and it still didn't break, but with Xamarin I am having a hard time just getting past the creation of the project without some error. Why is this? Does this happen to experienced Xamarin Developers or just for beginners?

There are certainly issues in Xamarin Mobile Development. Those issues you are referering, happen to everyone from time to time (not that common these days though).
Ignore compiling errors (assuming its the programmer's fault), those issues are usually related with Visual Studio. So, the process is always the same:
Clean Solution
Delete bin/objs folders (if the clean has errors)
Restart Visual Studio
Rebuild

Related

Trouble with initial distribution of C# .NET application

I've written an application in C# .NET with the WinForms UI toolkit. I'm attempting to provide Windows executables, but so far they simply don't work for anyone but me.
I'm creating the release packages by building the EXE and DLLs in Visual Studio 2017, copying them into one place, and putting that into a .zip archive. I'm not doing the fancy one-click publishing stuff.
The project is available on github (https://github.com/fadden/6502bench). The first person to try it got "<program> has stopped working" on Win7 (see issue). The second person was using Win10 Pro, and extracted some details from the event log that show it crashing in a system DLL (see issue). Both of them have the latest .NET framework installed.
I haven't worked with C# .NET outside Unity, so I'm a bit out of my depth. It's entirely possible I've skipped an "obvious" step, or am doing things wrong.
Update: answering some of the comments:
it's pure C#, no native or unsafe code
both people reporting problems confirmed that that latest .NET framework is installed (4.7.2)
the program doesn't seem to be starting at all, so I'm not sure what the app could be doing wrong as far as local paths go
the specific errors, including screen shots and log messages, are included in the issues linked above
the full source code, with the VS solution and projects, is up on github
The sense I'm getting from the comments is that what I'm doing isn't fundamentally wrong, so there's some devil in the details.
I downloaded the source, and debugged.
I received a StackOverFlowException on the following 2 lines of code.
ProjectView.cs
line 3545 : symbolListView.Columns[2].Width = lastWidth;
line 3719 : referencesListView.Columns[2].Width = lastWidth;
What is going on is you are handling the ColumnWidthChanged event on ListView components, and modifying the column width. This modification fires the event again, which is causing an infinite loop, and a subsequent StackOverflowException.
But why? I'll take a swing at an answer. You may have hard coded some values that line up with the DPI and resolution of your monitor. When the ListView instantiates on your machine, it doesn't have to 'redraw' the column with and does not fire the event, but for anyone else that doesn't have the same resolution and DPI, the event fires and causes the loop. I could be wrong, but sounds plausible to me.

Xamarin PCL Android app suddenly crashes in release mode

My Xamarin (PCL) Android application suddenly randomly crashes when it released. It sometimes happens even when you are not currently using it and then message that app stopped working appears.
I wonder, is there any way to track whats going on, maybe there are some logs which I could have a look, or anything else to find out what the issue as I said it randomly happens and hard to find the problem.
Many thanks in advance.
A fast solution would be to plug your device and use the Android Device Monitor to see if it print out something on the device logs. A more reliable solution would be of course to integrate a crash reporter system like what the others have suggested or Crashlytics.
You might need to add a crash reporting tool like HockeyApp or VS App Center, or wire up your own global exception handler

Xamarin.Android Deployment Error using Android Virtual Device

I am trying to setup a development environment in Visual Studio Community for development with Xamarin.Forms. In order to make sure the Android Emulator was working, I followed the QuickStart Xamarin.Android tutorial found here.
When I Start Debugging with any number of Virtual Devices the output is always the same; the application does not show up, but the AVD successfully starts up and I can also successfully interact with OS; when trying the close the AVD (with the x icon on the top right) a pop-up dialog appears saying "There were Deployment Errors. Do you wish to continue? Yes\No". The frustrating part is that no matter my response there is absolutely no useful error informations, or warnings or messages for that matter. You may think this is a duplicate question but it is not. I have had problems with a similar problem in which the fix was to downgrade my Android SDK BuildTools to a version lower than 24.0. The was to circumvent an upstream bug that provided the error message: java.lang.UnsupportedClassVersionError blah blah blah. The problem here is I get NO error and my highest version Build Tools are version 23.0.3 which should be fine. Here is a pic on start-up:
AVD
Unfortunately as I am only a begginer user I am not permitted to post more links and images. Apologies for the images as links I am still only permitted to post images in this way.
Thank you for taking the time to help me out.
Hi anyone with a similar problem, this is what worked for me in this particular case. I started the AVD before starting Debugging, the application then showed up in the emulators device menu and everthing is working. I have been stuck with this problem for Five whole day trying dozens of things. Pheeeeuuuuuuw!

How can I build a search system to find all references that require an android permission in my project?

Permissions that creep in between android builds of our app is a recurring problem for us at the office.
We work with Unity and use C#. In our project we use various 3rd party packages that we purchased from the Unity Asset Store and these packages update frequently. Sometimes we'll see a new permission creep in and we'll have to pinpoint the last git push to see when it exactly started appearing.
Doing all this stuff and tracking and scanning our code whenever we have an uncalled permission appear is a bit of a downer and takes considerable time.
I was wondering, theoretically speaking, if it's possible to write a script or a piece of code that creeps through our project and libraries within to give us a list of references that require android permissions.
Any guidance about this question is appreciated. I'm not a coder by trade and my knowledge isn't too strong over this subject so I apologize in advance if this questions is out of place.
So this is alittle bit tricky, because in Android Studio 1.5.1 seems like this function disappeared from lint for some reasons I dont know. So use any Android studio below 1.5.1 and it will be OK.
Analyze -> Run Inspection by Name -> "MissingPermissions".

Visual Studio 2010 and XNA game studio crashes while debugging code

Now, this is a problem I've been having for a while now. I've tried googling it, asking people I know, and have searched this site for ages, but have not been able to find a solution.
I am running XNA Game Studio 4.0 and Microsoft Visual Studio 2010. While trying some of the basic tutorials with XNA (Available on the Microsoft website), I encountered several errors:
First off, I had set up a basic Kernel32.dll console, to calculate and display FPS. For some odd reason, after a seemingly random amount of time had elapsed it started updating the FPS several times a second. As the program ran fine, I presumed it was an error with my code, and so removed it.
But, when I did this, the program just seemed to crash. The only code in the program so far is simple draw calls, basic movement, and the foundations of a rudimentary inventory system. There is no complex code happening. I have tried several things, including placing break points on every line of code and spending hours attempting to sort this out.
So, my question is: Is this an entirely random occurrence, or is it most likely a problem with my code? And more importantly, is there a way to prevent such a bug from happening?
Any help will be greatly appreciated.
Code:
http://pastebin.com/3sRiVnwe

Categories

Resources