Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several AndroidImplementation Exceptions #523

Closed
codenameone opened this issue Mar 27, 2015 · 4 comments
Closed

Several AndroidImplementation Exceptions #523

codenameone opened this issue Mar 27, 2015 · 4 comments

Comments

@codenameone
Copy link
Collaborator

Original issue 523 created by codenameone on 2013-02-03T21:29:58.000Z:

I had the following 3 exceptions reported from AndroidImplementation.

java.lang.IllegalArgumentException
at android.view.Surface.unlockCanvasAndPost(Native Method)
at android.view.SurfaceView$4.unlockCanvasAndPost(SurfaceView.java:781)
at com.codename1.impl.android.AndroidView.void flushGraphics(android.graphics.Rect)(SourceFile:276)
at com.codename1.impl.android.AndroidImplementation.void flushGraphics(int,int,int,int)(SourceFile:548)
at com.codename1.impl.CodenameOneImplementation.void paintDirty()(SourceFile:378)
at com.codename1.ui.Display.void edtLoopImpl()(SourceFile:932)
at com.codename1.ui.Display.void mainEDTLoop()(SourceFile:871)
at com.codename1.ui.RunnableWrapper.void run()(SourceFile:119)
at com.codename1.impl.CodenameOneThread.void run()(SourceFile:175)

java.lang.NullPointerException
at com.codename1.impl.android.AndroidImplementation.int getImageWidth(java.lang.Object)(SourceFile:951)
at com.codename1.ui.Image.int getWidth()(SourceFile:616)
at com.codename1.ui.plaf.DefaultLookAndFeel.void drawComponent(com.codename1.ui.Graphics,com.codename1.ui.Label,com.codename1.ui.Image,com.codename1.ui.Image,int)(SourceFile:969)
at com.codename1.ui.plaf.DefaultLookAndFeel.void drawLabel(com.codename1.ui.Graphics,com.codename1.ui.Label)(SourceFile:360)
at com.codename1.ui.Label.void paint(com.codename1.ui.Graphics)(SourceFile:335)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paint(com.codename1.ui.Graphics)(SourceFile:824)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paint(com.codename1.ui.Graphics)(SourceFile:824)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paint(com.codename1.ui.Graphics)(SourceFile:824)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paint(com.codename1.ui.Graphics)(SourceFile:824)
at com.codename1.ui.Form.void paint(com.codename1.ui.Graphics)(SourceFile:2446)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics)(SourceFile:927)
at com.codename1.ui.Component.void paintComponent(com.codename1.ui.Graphics,boolean)(SourceFile:1166)
at com.codename1.ui.Component.void paintComponent(com.codename1.ui.Graphics)(SourceFile:1119)
at com.codename1.impl.CodenameOneImplementation.void paintDirty()(SourceFile:360)
int getAlpha(java.lang.Object)
java.io.FileInputStream openFileInputStream(java.lang.String)
at com.codename1.ui.Display.void edtLoopImpl()(SourceFile:932)
at com.codename1.ui.Display.void mainEDTLoop()(SourceFile:871)
at com.codename1.ui.RunnableWrapper.void run()(SourceFile:119)
at com.codename1.impl.CodenameOneThread.void run()(SourceFile:175)

java.lang.NullPointerException
at android.graphics.Canvas.throwIfRecycled(Canvas.java:964)
at android.graphics.Canvas.drawBitmap(Canvas.java:990)
at com.codename1.impl.android.AndroidImplementation.void drawImage(java.lang.Object,java.lang.Object,int,int)(SourceFile:956)
at com.codename1.ui.Graphics.void drawImage(java.lang.Object,int,int)(SourceFile:512)
at com.codename1.ui.Graphics.void drawImage(java.lang.Object,int,int,int)(SourceFile:522)
at com.codename1.ui.Image.void drawImage(com.codename1.ui.Graphics,java.lang.Object,int,int)(SourceFile:643)
at com.codename1.ui.Graphics.void drawImage(com.codename1.ui.Image,int,int)(SourceFile:486)
at com.codename1.components.InfiniteProgress.void paint(com.codename1.ui.Graphics)(SourceFile:133)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paint(com.codename1.ui.Graphics)(SourceFile:824)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:997)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Container.void paintIntersecting(com.codename1.ui.Graphics,com.codename1.ui.Component,int,int,int,int,boolean)(SourceFile:883)
at com.codename1.ui.Component.void paintIntersectingComponentsAbove(com.codename1.ui.Graphics)(SourceFile:1019)
at com.codename1.ui.Component.void internalPaintImpl(com.codename1.ui.Graphics,boolean)(SourceFile:1005)
at com.codename1.ui.Component.void paintInternalImpl(com.codename1.ui.Graphics,boolean)(SourceFile:976)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics,boolean)(SourceFile:959)
at com.codename1.ui.Component.void paintInternal(com.codename1.ui.Graphics)(SourceFile:927)
at com.codename1.ui.Component.void paintComponent(com.codename1.ui.Graphics,boolean)(SourceFile:1166)
at com.codename1.ui.Component.void paintComponent(com.codename1.ui.Graphics)(SourceFile:1119)
at com.codename1.impl.CodenameOneImplementation.void paintDirty()(SourceFile:360)
int getAlpha(java.lang.Object)
java.io.FileInputStream openFileInputStream(java.lang.String)
at com.codename1.ui.Display.void edtLoopImpl()(SourceFile:932)
at com.codename1.ui.Display.void mainEDTLoop()(SourceFile:871)
at com.codename1.ui.RunnableWrapper.void run()(SourceFile:119)
at com.codename1.impl.CodenameOneThread.void run()(SourceFile:175)

@codenameone
Copy link
Collaborator Author

Comment #1 originally posted by codenameone on 2013-02-04T07:28:55.000Z:

<empty>

@codenameone
Copy link
Collaborator Author

Comment #2 originally posted by codenameone on 2013-02-04T13:12:00.000Z:

Looking at the stack trace it's not clear why these exceptions occur, can you please provide the code that reproduce this? and let me know how to reproduce these errors?

@codenameone
Copy link
Collaborator Author

Comment #3 originally posted by codenameone on 2013-02-04T21:16:07.000Z:

Unfortunately, I don't have any way to reproduce these exceptions. I modified Display.mainEDTLoop such that all exceptions there are reported to my database instead of using the CN1 crash reporter so I would know when these exceptions occurred. Across all of the devices my app is on, these exceptions get thrown every once in a while. I reported them just so you would be aware of them. Sorry I can't be of more help. If you think it would be helpful, I can probably go through and compile a list of the devices they occurred on.

@codenameone
Copy link
Collaborator Author

Comment #4 originally posted by codenameone on 2013-02-05T08:47:14.000Z:

These are application exceptions. Both are roughly the same meaning the native image underlying a Codename One image is null.
We load the physical image lazily and so if image creation failed this might happen after the image loaded. You would then have a null native image so get width will fail and so would drawing it.

Without the code we can't really help you here, I would bet this is an issue related to your ad support where you download images dynamically. One of them might be failing, we usually solve this by calling getWidth() explicitly catching the exception if the image failed and then moving on.

@codenameone codenameone removed their assignment Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants