nativescript-slides icon indicating copy to clipboard operation
nativescript-slides copied to clipboard

OutOfMemory Error doInBackground() function

Open MeteALANLI opened this issue 9 years ago • 2 comments

HomePage.prototype.onSlideContainerLoaded = function (args) { if(!appSettings.getBoolean("is_logged")) { frames.topmost().navigate("pages/login/login"); } else{ var slideContainer = args.object; slideContainer.style.visibility = "collapsed"; var slides = config.slider_list; var count = 0; slides.forEach(function (slide) { slideContainer.addChild(getSlide(slide.slider_name,slide.slider_image)); count++; }); slideContainer.style.visibility = "visible"; } } function getSlide(labelText,image) { var slide = new slides.Slide(); slide.style.backgroundImage = "url('"+image+"')"; slide.style.backgroundRepeat = "no-repeat"; slide.style.backgroundPosition = "center"; slide.style.backgroundSize = "cover"; return slide; }

I am Creating my Slides Like that There is XML;

<Slides:SlideContainer loaded="onSlideContainerLoaded" height="35%" pageIndicators="true" > </Slides:SlideContainer>

And When Use this plugin i am getting this error: java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)Caused by: java.lang.OutOfMemoryError: Failed to allocate a 14745612 byte allocation with 12939040 free bytes and 12MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:763) at org.nativescript.widgets.Async$Http$RequestResult.readResponseStream(Async.java:225) at org.nativescript.widgets.Async$Http$HttpRequestTask.doInBackground(Async.java:303) at org.nativescript.widgets.Async$Http$HttpRequestTask.doInBackground(Async.java:253) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) ... 3 more

Why it's happening ?

MeteALANLI avatar Sep 03 '16 10:09 MeteALANLI

Sorry my son got. Hold of my phone. I'll look into this next chance I have

JoshDSommer avatar Sep 03 '16 21:09 JoshDSommer

oh okay no problem ty for interests. This bug can be effect all over program.

MeteALANLI avatar Sep 04 '16 09:09 MeteALANLI