Background Working with Xamarin.Android (or Xamarin.Forms with Android) you might encounter this error when making HTTP/REST calls to an API, even if you think your making the call async. So what’s up with that? The Culprit What can commonly happen is you got some nested async call like this (simplified):
public async Task<TokenResponse> Login(string username, string password)
this.TokenResponse = await this.Authenticate(username, password);
While Login will begin to execute async and the nested call to Authenticate (signature async Task<TokenResponse>) will also do so the assignment to this.TokenResponse (a […]
Here’s a simplified description of the Xamarin framework and tips on how to resolve those platform specific exceptions.
Here’s some basic tips to get your app running smoothly: Enable new Garbage Collector Add a text file to your Android project with build action Android Environment and set params. Here’s an example for using the tarjan GC:
# Comments are lines which start with '#'
# Blank lines are ignored.
# Use new Garbage Collector
# Enable GREF messages to `adb logcat`
# Use new client handler
# Clear out a Mono environment variable to decrease logging
Source: https://blog.xamarin.com/xamarin-android-garbage-collection-improvements/ https://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/#GC_Bridge_Options Java.lang.OutOfMemoryError If you’re getting these it means you haven’t allocated enough memory to Java. To do this, check your Android project’s properties and set Java Max Heap Size to “1G”. Do this […]
You may receive tricky Cryptography errors from Android / Java