We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

java.lang.outofMemoryError when building Android application

Thread ID:

Created:

Updated:

Platform:

Replies:

124465 Jun 13,2016 03:47 AM UTC Sep 9,2016 11:16 AM UTC Xamarin.Android 5
loading
Tags: SfRotator
Jeff Lindborg
Asked On June 13, 2016 03:47 AM UTC

Just trying to build a simple test application for Android and iOS in a Forms project - added dependencies as documented but when building the Android project it throws this error - iOS looks to compile and run ok.

Error java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar C:\Users\lindb_000\AppData\Local\Android\android-sdk\build-tools\23.0.1\\lib\dx.jar --no-strict --dex --output=obj\Release\android\bin obj\Release\android\bin\classes "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\mono.android.jar" obj\Release\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar obj\Release\__library_projects__\Syncfusion.SfChart.Android\library_project_imports\bin\SfChart.Android.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\embedded\classes.jar C:\Users\lindb_000\AppData\Local\Xamarin\Xamarin.Android.Support.Vector.Drawable\23.3.0.0\embedded\classes.jar' StickBuddy.Droid


Saravana Pandian Murugan [Syncfusion]
Replied On June 13, 2016 09:05 AM UTC

Hi Jeff,

Thanks for contacting Syncfusion support.

The “java.lang.OutOfMemoryError” error is a Xamarin issue which occurs when the app size exceeds some limit. You can refer to the following bug report.

https://bugzilla.xamarin.com/show_bug.cgi?id=18327  

Solution:

Right click the Android project and select Properties > Android Options > Advanced

Set the Java Heap size as 1G.

Thanks,
Saravana Pandian M.


Jeff Lindborg
Replied On June 13, 2016 12:03 PM UTC

ah, cool - that did the trick, I'm off to the races now.
thanks much.


Saravana Pandian Murugan [Syncfusion]
Replied On June 14, 2016 04:44 AM UTC

Hi Jeff,

Thanks for the update. We are glad to know that the given solution works. Please contact us if you need any further assistance.

Regards,
Saravana Pandian M. 


Javier
Replied On September 8, 2016 05:17 PM UTC

HI, i have the same problem but i using sfrotator. I increase the amount of memory JavaMaximumHeapSize "<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>" but my problem is still there.

09-08 13:23:05.001 E/mono-rt (27016): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.OutOfMemoryError: Exception of type 'Java.Lang.OutOfMemoryError' was thrown.
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
09-08 13:23:05.001 E/mono-rt (27016):   at Java.Interop.JniEnvironment+StaticMethods.CallStaticObjectMethod (JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00082] in /Users/builder/data/lanes/3415/ffca580c/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12649
09-08 13:23:05.001 E/mono-rt (27016):   at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeObjectMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x0001b] in /Users/builder/data/lanes/3415/ffca580c/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:97
09-08 13:23:05.001 E/mono-rt (27016):   at Android.Graphics.BitmapFactory.DecodeResource (Android.Content.Res.Resources res, Int32 id) [0x0003f] in /Users/builder/data/lanes/3415/ffca580c/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Graphics.BitmapFactory.cs:656
09-08 13:23:05.001 E/mono-rt (27016):   at Android.Graphics.BitmapFactory+<DecodeResourceAsync>c__AnonStorey6.<>m__0 () [0x00000] in /Users/builder/data/lanes/3415/ffca580c/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Graphics.BitmapFactory.cs:664
09-08 13:23:05.001 E/mono-rt (27016):   at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x00012] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:680
09-08 13:23:05.001 E/mono-rt (27016):   at System.Threading.Tasks.Task.Execute () [0x00016] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502
09-08 13:23:05.001 E/mono-rt (27016): --- End of stack trace from previous location where exception was thrown ---
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
09-08 13:23:05.001 E/mono-rt (27016):   at Xamarin.Forms.Platform.Android.FileImageSourceHandler+<LoadImageAsync>d__4.MoveNext () [0x000f3] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\FileImageSourceHandler.cs:23
09-08 13:23:05.001 E/mono-rt (27016): --- End of stack trace from previous location where exception was thrown ---
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
09-08 13:23:05.001 E/mono-rt (27016):   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e]


Hemalatha Marikumar [Syncfusion]
Replied On September 9, 2016 11:16 AM UTC

Hi Javier,

Thanks for your update.

We have checked the reported issue with SfRotator. We were unable to reproduce the reported issue at our end. Please update whether you are facing this issue when swiping the rotator control's item continuously or deploying the sample with the control (In which scenario you faced this issue). It will help to analyze further and provide an appropriate solution.

Regards,
Hemalatha M.R.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;