How to resolve java.lang.outofmemoryerror in xamarin forms portable project set as android as starti

gdkgdk INMember ✭✭✭

Hi everyone, I have very tired with getting java lang out of memory exception in xamarin android project. I didn't find what the root cause of getting this exception. In my android properties set up heap size is '1G' but still getting same issue.I am not getting any issue while xamarin ios project set as starting project.So many post's are suggest to these following solutions 1. increase heap size 2.set large hepad size is true in android manifest file, I am fallow those solutions but getting same issue. Here is the error what I am getting. Please suggest any idea of how to fix this issue.
enter image description here

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    Do you use images?
  • gdkgdk INMember ✭✭✭

    Hi Caliaro. Yes I am using images in some other page but those images are loaded when go to that page only and other thing is those are not loaded from 'drawable' folder those are loaded using 'url's'.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    Have you tried to deploy it to a real device?
  • gdkgdk INMember ✭✭✭

    First I am testing in 'Genymotion player' it's getting crashed and showing java lang out of memory exception. I think 'Genymotion' player act as a physical device then after I have tried in physical device also getting same issue.

  • gdkgdk INMember ✭✭✭

    In my project I have load one of the page full of images like gallery, Those images are loaded from url's. When I go to that page directly also getting same issue. How can we resolve these issue if we are using images.

  • gdkgdk INMember ✭✭✭
    edited September 2017

    I have install 'FFImageLoading Plugin for xamarin ios/android' nuget package and try to write 'CatchedImageRenderer.Init()' line in main activity contain oncreate() method but it show's error. When I go to that sample they are using assembly references like 'using ffimageloading.forms.android' in main activity but when I write those assembly references in my main activity shows error, I am install ffimageloading package in both android and portable classes. Please suggest what the cause of it.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    @DanielL can you help this friend?

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭✭

    Isn't it just a typo? In comment, you've placed:
    CatchedImageRenderer.Init()
    and NOT:
    CachedImageRenderer.Init();

  • gdkgdk INMember ✭✭✭

    @ => Namyslaw Szymaniuk

    I have tried with both 'CatchedImageRenderer.Init()' and 'CachedImageRenderer.Init();' but both are show's error.

  • NamyslawSzymaniukNamyslawSzymaniuk USMember ✭✭✭✭
    edited September 2017

    Have you installed Xamarin.FFImageLoading + Xamarin.FFImageLoading.Forms ? Of course both in PCL + Android + iOS projects?

  • gdkgdk INMember ✭✭✭

    Thank you much Namyslaw Szymaniuk. Finally I have installed ffimageloading in my project. In previous I have missed up two things 1. I am installing either on of the package at a time. 2. I am not installing those packages in to portable project only try to installed with android project. any way thanks once again thanks. Now I will started implementing those ffimage loading in my project.

  • gdkgdk INMember ✭✭✭

    Hi all, Getting out of memory exception while loading images using 'ffimageloader' also. Many post suggest if we use ffimageloader insted image in xamal page for loading images we are not getting this type of issues but I am still getting this issue. Can you please suggest what I am missing.

  • DanielLDanielL PLInsider ✭✭✭✭

    @gdk Do you use CarouselView in your code?

  • gdkgdk INMember ✭✭✭

    @DanielL

    No Daniel. I am using wrap view.

  • aismaniottoaismaniotto Member ✭✭

    Hi, have you find some answer? I am having a very similar problem.

Sign In or Register to comment.