{ "id": "85508", "key": "TIMOB-7416", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12095", "description": "", "name": "Sprint 2012-03", "archived": true, "released": true, "releaseDate": "2012-02-12" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-14T23:29:00.000+0000", "created": "2012-01-25T23:16:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [ { "id": "15081", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85488", "key": "TIMOB-7412", "fields": { "summary": "Android: V8/Rhino: Animation: Setting animation on a lightweight window makes the window color go transparent", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-27T12:17:08.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "When running the following code, the animation occurs correctly the first time I click on the view--the green box spins around once, then stops. (If run in a lightweight window, at the finish of the animation, there's a visual anomaly where part of the underlying window shows through. But this is not the bug in question.)\r\n\r\nThe second time I click on the view, the app crashes immediately. Stack trace included below code.\r\n\r\n{code}\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n\tbackgroundColor : \"white\"\r\n});\r\nvar view = Ti.UI.createView({\r\n\theight : 100,\r\n\twidth : 100,\r\n\tbackgroundColor : \"green\"\r\n});\r\nwin1.add(view);\r\nwin1.open();\r\n\r\nvar matrix = Ti.UI.create2DMatrix();\r\nvar matrix1 = matrix.rotate(120);\r\nvar matrix2 = matrix.rotate(240);\r\nvar transforms = [matrix, matrix1, matrix2];\r\n// We start at 0, so the first rotation is to 120 degrees\r\nvar nextTransform = 1;\r\nanimation = Ti.UI.createAnimation({\r\n\ttransform : transforms[nextTransform],\r\n\tduration : 500,\r\n});\r\n// On iOS, override the default easing to avoid \r\n// jerky transitions between animations.\r\nif (Ti.Platform.name === 'iPhone OS') {\r\n\tanimation.curve = Ti.UI.iOS.ANIMATION_CURVE_LINEAR;\r\n}\r\n\r\nanimation.addEventListener('complete', function(e) {\r\n\t// view.transform = transforms[nextTransform];\r\n\tif(nextTransform == 0) {\r\n\t\t// Rotation complete, reset for next time\r\n\t\tnextTransform = 1;\r\n\t\tanimation.transform = transforms[nextTransform];\r\n\t} else {\r\n\t\t// Rotate to the next position\r\n\t\tnextTransform = (nextTransform + 1) % 3;\r\n\t\tanimation.transform = transforms[nextTransform];\r\n\t\tview.animate(animation);\r\n\t}\r\n});\r\n\r\nview.addEventListener('click', function(e) {\r\n\tview.animate(animation);\r\n});\r\n{code}\r\n\r\nStack trace:\r\n\r\n{code}\r\nE/AndroidRuntime( 421): FATAL EXCEPTION: main\r\nE/AndroidRuntime( 421): java.lang.NullPointerException\r\nE/AndroidRuntime( 421): \tat org.appcelerator.titanium.view.Ti2DMatrix.interpolate(Ti2DMatrix.java:187)\r\nE/AndroidRuntime( 421): \tat org.appcelerator.titanium.util.TiAnimationBuilder$TiMatrixAnimation.applyTransformation(TiAnimationBuilder.java:416)\r\nE/AndroidRuntime( 421): \tat android.view.animation.AnimationSet.initializeInvalidateRegion(AnimationSet.java:286)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1498)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1638)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)\r\nE/AndroidRuntime( 421): \tat android.view.View.draw(View.java:6743)\r\nE/AndroidRuntime( 421): \tat android.widget.FrameLayout.draw(FrameLayout.java:352)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1640)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.drawChild(ViewGroup.java:1638)\r\nE/AndroidRuntime( 421): \tat android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)\r\nE/AndroidRuntime( 421): \tat android.view.View.draw(View.java:6743)\r\nE/AndroidRuntime( 421): \tat android.widget.FrameLayout.draw(FrameLayout.java:352)\r\nE/AndroidRuntime( 421): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)\r\nE/AndroidRuntime( 421): \tat android.view.ViewRoot.draw(ViewRoot.java:1407)\r\nE/AndroidRuntime( 421): \tat android.view.ViewRoot.performTraversals(ViewRoot.java:1163)\r\nE/AndroidRuntime( 421): \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1727)\r\nE/AndroidRuntime( 421): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\nE/AndroidRuntime( 421): \tat android.os.Looper.loop(Looper.java:123)\r\nE/AndroidRuntime( 421): \tat android.app.ActivityThread.main(ActivityThread.java:4627)\r\nE/AndroidRuntime( 421): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\nE/AndroidRuntime( 421): \tat java.lang.reflect.Method.invoke(Method.java:521)\r\nE/AndroidRuntime( 421): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\nE/AndroidRuntime( 421): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\nE/AndroidRuntime( 421): \tat dalvik.system.NativeStart.main(Native Method)\r\n{code}\r\n\r\nI tried to simplify the test case by removing the complete handler, so there's only a single animation: however, for some reason I can't get the animation to run at all in that case.\r\n", "attachment": [], "flagged": false, "summary": "Android: Simple animation causes application crash", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "181473", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Community Discussion:\r\n\r\nhttp://developer.appcelerator.com/question/131556/animation-in-andriod-app-not-working\r\n", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-02-02T09:50:57.000+0000", "updated": "2012-02-02T09:50:57.000+0000" }, { "id": "182122", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.9.0.v20120206143134 on Kindle Fire and Emulator 2.2 no longer encountering the crash, see linked bug for the animation problem ", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T15:32:24.000+0000", "updated": "2012-02-06T15:32:24.000+0000" }, { "id": "281624", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR link:\nhttps://github.com/appcelerator/titanium_mobile/pull/5037", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-27T12:17:08.000+0000", "updated": "2013-11-27T12:17:08.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }