Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1969] Android: ImageView.setBorderRadius crashes the app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2013-04-26T21:07:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsparity
ReporterYgor Lemos
AssigneeMauro Parra-Miranda
Created2013-04-25T22:39:10.000+0000
Updated2016-03-08T07:40:54.000+0000

Description

*Problem description* Running a .setBorderRadius(10) on an already instanced imageview crashes the app. *Note* The code works perfectly on iOS. *Test case*
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow();
var image = Ti.UI.createImageView({
	image : 'KS_nav_ui.png',
	borderWidth : 1
});
image.setBorderRadius(10);
win.add(image);
win.open();
*Logcat*
D/AndroidRuntime(24520): Shutting down VM
W/dalvikvm(24520): threadid=1: thread exiting with uncaught exception (group=0x40ec92a0)


E/TiApplication(24520): (main) [15525,46501] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.0,2013/04/15 18:46,57634ef
E/TiApplication(24520): java.lang.NullPointerException
E/TiApplication(24520): 	at org.appcelerator.titanium.view.TiUIView.handleBorderProperty(TiUIView.java:1027)
E/TiApplication(24520): 	at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:619)
E/TiApplication(24520): 	at ti.modules.titanium.ui.widget.TiUIImageView.propertyChanged(TiUIImageView.java:833)
E/TiApplication(24520): 	at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
E/TiApplication(24520): 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1008)
E/TiApplication(24520): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
E/TiApplication(24520): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/TiApplication(24520): 	at android.os.Looper.loop(Looper.java:137)
E/TiApplication(24520): 	at android.app.ActivityThread.main(ActivityThread.java:4898)
E/TiApplication(24520): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/TiApplication(24520): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/TiApplication(24520): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
E/TiApplication(24520): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
E/TiApplication(24520): 	at dalvik.system.NativeStart.main(Native Method)



E/AndroidRuntime(24520): FATAL EXCEPTION: main
E/AndroidRuntime(24520): java.lang.NullPointerException
E/AndroidRuntime(24520): 	at org.appcelerator.titanium.view.TiUIView.handleBorderProperty(TiUIView.java:1027)
E/AndroidRuntime(24520): 	at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:619)
E/AndroidRuntime(24520): 	at ti.modules.titanium.ui.widget.TiUIImageView.propertyChanged(TiUIImageView.java:833)
E/AndroidRuntime(24520): 	at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21)
E/AndroidRuntime(24520): 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1008)
E/AndroidRuntime(24520): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
E/AndroidRuntime(24520): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(24520): 	at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(24520): 	at android.app.ActivityThread.main(ActivityThread.java:4898)
E/AndroidRuntime(24520): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(24520): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(24520): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
E/AndroidRuntime(24520): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
E/AndroidRuntime(24520): 	at dalvik.system.NativeStart.main(Native Method)


W/ActivityManager( 2266): Process br.com.pinion has crashed too many times: killing!

Comments

  1. Jamie Buckley 2013-04-26

    Hi Ygor, Please provide a small test case so that we can verify this issue.
  2. Daniel Sefton 2013-04-26

    I added a test case, but cannot reproduce the issue on 3.1 GA, Samsung Galaxy S2 2.3.6. Ygor: Please adapt the test case to reproduce your crash. Thanks.

JSON Source