I have an Xamarin Forms Android App in the version version 2.5.1.527436 and now I want to upgrade the Xamarin Forms version to 5.0.0.2012 to update the controls used in the app and improve it.
After updating the Xamarin forms version to 5.0.0.2012, I am facing the Java.lang. Out of memory exceptions in the starting page of the app after the splash screen. Below is the crash report.
java.lang.OutOfMemoryError: Failed to allocate a 7814092184 byte allocation with 1912926 free bytes and 510MB until OOM, max allowed footprint 3825854, growth limit 536870912
at crc643f46942d9dd1fff9.ButtonRenderer_ButtonClickListener.n_onClick(Native Method)
at crc643f46942d9dd1fff9.ButtonRenderer_ButtonClickListener.onClick(ButtonRenderer_ButtonClickListener.java:30)
at android.view.View.performClick(View.java:6304)
at android.view.View$PerformClick.run(View.java:24803)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6635)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
I have tried the below solutions and it does not fix the problem.
How to fix Java.Lang.OutOfMemoryError in Xamarin.Forms android application?
Why does the exception occur?