[英]Xamarin Forms Android out java.lang.OutOfMemoryError exception
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. 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.将Xamarin forms版本更新到5.0.0.2012后,我面对的是Java.lang。 Out of memory exceptions in the starting page of the app after the splash screen.
在启动屏幕后的应用程序的起始页面中出现 memory 异常。 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? 如何修复 Xamarin.Forms ZC3FCZD3759213819Z.Lang.OutOfMemoryError 中的 Java.Lang.OutOfMemoryError?
Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM Android:java.lang.OutOfMemoryError: 无法分配 23970828 字节分配与 2097152 空闲字节和 2MB 直到 OOM
Why does the exception occur?为什么会出现异常?
Making an update that big sometimes is hard.有时很难进行如此大的更新。 You can try doing a small upgrade first, let's say to Xamarin.Forms 4, if the problem is solved, you might want to go to XF 4.8 or directly to 5.0.
你可以先尝试做一个小升级,比如说Xamarin.Forms 4,如果问题解决了,你可能想Z34D1F91FB2E514B8576FAB1A745A89A6B.80直接升级到XF。
You can go to any version that you like, but then your final goal will be 5.0您可以 go 到您喜欢的任何版本,但您的最终目标将是 5.0
The solutions that you posted about the specific error, increase the heap.您发布的有关特定错误的解决方案增加了堆。 But maybe you should try to look for the cause of the error.
但也许你应该尝试寻找错误的原因。 It can be at your App class, or maybe your XAML, but trying to optimize it it's also a good practise
它可以在您的应用程序 class 或 XAML 中,但尝试优化它也是一个好习惯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.