Hi everyone,
I would like advice streamlining my development experience with Xamarin because it has been quite frustrating so far.
I even got to the point that I left my project which was working for a month or 2 and returned with it crashing and me not being able to get it up and running again, after which I decided I was going to rebuild it from scratch.
I can't imagine that my current debugging problems are the norm so I guess I must be doing something wrong somewhere. I'd like to find out what.
It could be so that half of my problems are not Xamarin related but Visual studio related, but I don't seem to be experiencing them when I'm developing other type of applications.
I have a firm background in developing console / wpf / asp / webapi / etc c# projects but I'm still kinda new to Xamarin.
I'm trying to build a Xamarin forms app (focussing on android first, if I get that up and running then maybe also IOS / UWP)
I mostly use the android emulator with an newly created AVD (platform 7.1.1 api level 25)
Why am I frustrated:
- when my code breaks my dev environment (vs 2017 on win10) almost never stops where the problem occurs (nullreference / throw exception) it just seems to crash hard on the emulator. I have to step through my code or use the output window to see if I can decypher a cause. I usually get an "An unhandled exception occurred" message with "no compatible code running".
- errors that I get to see are often not helpfull in diagnosing the problem.
- quite a lot of times the app just crashes on startup in the emulator, not giving me any log.
- given the points above I try to take babysteps to verify it still works. This in combination with the slowness of the debuggingcycle (buidling/deploying) on an android emulator takes the speed out of my development.
- I seem to be getting different results from time to time between debugging on my physical device / the emulator / after a solution clean / reboot. That does not help in my general feeling of building on a solid foundation.
- the logcat output of my emulator produces a lot of noise (warnings / errors) not related to my application
- the output window which shows during the debugging seems to contain a lot of errors (red text) that do not relate to problems (they also appear when the app is functioning fine) for instance D/Mono (28288): AOT: image 'System.ComponentModel.TypeConverter.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.TypeConverter.dll.so" not found
Things I've chosen to do which might impact my current experience:
- use .net standard (2.0) instead of pcl
- use packagereferences where I can instead of packages.config
- using freshmvvm with it's IOC to resolve services
Things on my mind that I could be doing wrong:
- some kind of debugging setting is wrong
- I am not aware of some debugging strategy that exists and could make my life easier diagnosing problems
- some kind of build problem that prevents de debugger on the emulator from working correctly (getting errors like 12-08 11:00:39.404 D/Mono (28288): AOT: image 'System.ComponentModel.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.dll.so" not found)
- am I using the right kind of emulator?
My current debugging tools
- output window
- error list
- stepping through code
- device log (logcat)
Any help would be appreciated