Math

android for iink sdk

Dear Olivier,

  I found the error.

     E/AndroidRuntime: FATAL EXCEPTION: main

                  Process: com.myscript.iink.getstarted, PID: 3783

                  java.lang.OutOfMemoryError: Failed to allocate a 7270572 byte allocation with 3959632 free bytes and 3MB until OOM

                      at dalvik.system.VMRuntime.newNonMovableArray(Native Method)

                      at android.graphics.Bitmap.nativeCreate(Native Method)

                      at android.graphics.Bitmap.createBitmap(Bitmap.java:817)

                      at android.graphics.Bitmap.createBitmap(Bitmap.java:794)

                      at android.graphics.Bitmap.createBitmap(Bitmap.java:761)

                      at com.myscript.iink.getstarted.LayerView.onSizeChanged(LayerView.java:166)

                      at android.view.View.sizeChange(View.java:15711)

                      at android.view.View.setFrame(View.java:15684)

                      at android.view.View.layout(View.java:15600)

                      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)

                      at android.widget.FrameLayout.onLayout(FrameLayout.java:508)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)

                      at android.widget.FrameLayout.onLayout(FrameLayout.java:508)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)

                      at android.widget.FrameLayout.onLayout(FrameLayout.java:508)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:443)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)

                      at android.widget.FrameLayout.onLayout(FrameLayout.java:508)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)

                      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)

                      at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)

                      at android.widget.FrameLayout.onLayout(FrameLayout.java:508)

                      at android.view.View.layout(View.java:15604)

                      at android.view.ViewGroup.layout(ViewGroup.java:4967)

                      at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2105)

                      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1855)

                      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1079)

                      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5839)

                      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:835)

                      at android.view.Choreographer.doCallbacks(Choreographer.java:634)

                      at android.view.Choreographer.doFrame(Choreographer.java:600)

                      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:821)

                      at android.os.Handler.handleCallback(Handler.java:739)

                      at android.os.Handler.dispatchMessage(Handler.java:95)

                      at android.os.Looper.loop(Looper.java:135)

                      at android.app.ActivityThread.main(ActivityThread.java:5318)

                      at java.lang.reflect.Method.invoke(Native Method)

                      at java.lang.reflect.Method.invoke(Method.java:372)

                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:922)

                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:717)

Why??

1 Comment

Dear See Love,

the error is indicated in the log: when resizing the layout, the image size is 7.3 MB, while you only have 4 MB left. You then have an out of memory.

To prevent from it, you should use a smaller image for the layout.

Best regards,

Olivier
Login or Signup to post a comment