{ "id": "174339", "key": "TIMOB-27698", "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": [], "resolution": null, "resolutiondate": null, "created": "2019-11-06T10:58:41.000+0000", "priority": null, "labels": [], "versions": [ { "id": "20832", "name": "Release 8.3.0", "archived": false, "released": true, "releaseDate": "2019-11-25" } ], "issuelinks": [], "assignee": null, "updated": "2020-01-27T16:14:59.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hi, since the recents updates of iOS 13 and SDK 8.2.X I'm updating all my apps.\r\nOne of them now crashes after taking a photo from camera or gallery.\r\nI'm attaching the code to reproduce but I've found that the problem is the $.UI.create method.\r\n\r\n\r\n{code:java}\r\n// After granted all permission for camera\r\nfunction takePhoto(callback){\r\nTitanium.Media.showCamera({\r\nsuccess:function(event)\r\n{\r\nvar selectedImage = event.media;\r\nvar heightOfImage = selectedImage.height;\r\nvar widthOfImage = selectedImage.width;\r\nvar aspectRatio = heightOfImage / widthOfImage;\r\nvar newWidth = 1000;\r\nvar newHeight = Math.round(newWidth*aspectRatio);\r\nvar newBlob = selectedImage.imageAsResized(newWidth, newHeight);\r\nvar newBlobCompressed = newBlob.imageAsCompressed(0.5);\r\ncallback(newBlobCompressed);\r\n}\r\n});\r\n}\r\n\r\nvar callbackInsertImage = function(blob){\r\n//I need a container for other purposes\r\nvar vista = $.UI.create('View', {height:'95', width:'95', left:'5'});\r\nvar image = $.UI.create('ImageView', {height:'95', width:'95', image: blob});\r\nvista.add(image);\r\n$.vista.add(vista);\r\n}\r\n\r\ntakePhoto(callbackInsertImage)\r\n{code}\r\n\r\nThis one above causes:\r\n{color:#d04437}[WARN] : Attempted to load TiUIImageViewProxy: Could not find class definition.\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 35;\r\n[ERROR] : line = 230;\r\n[ERROR] : message = \"invalid method (createImageView) passed to UIModule\";\r\n[ERROR] : nativeStack = \"3 CoreFoundation 0x000000019bef2d90 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 1252752\\n4 CoreFoundation 0x000000019bdc2bd0 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 7120\\n5 TitaniumKit0x00000001051ac9a4 -[KrollMethod call:] + 664\\n6 TitaniumKit0x00000001051abe3c __KrollCallAsFunction_block_invoke + 36\\n7 TitaniumKit0x00000001051abc48 KrollCallAsFunction + 408\\n8 JavaScriptCore 0x00000001aaca64cc 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2540748\\n9 JavaScriptCore 0x00000001ab286040 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 8699968\\n10 JavaScriptCore 0x00000001aac78114 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2351380\\n11 JavaScriptCore 0x00000001aac78080 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2351232\\n12 JavaScriptCore 0x00000001aac78128 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2351400\\n13 JavaScriptCore 0x00000001aac78128 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2351400\\n14 JavaScriptCore 0x00000001aac597e8 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 2226152\\n15 JavaScriptCore 0x00000001ab1b7258 6D4E079B-CBD2-3403-88DF-E601466DFD46 + 7852632\\n16 JavaScriptCore 0x00000001ab3a1970 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 184\\n17 JavaScriptCore 0x00000001aacb33cc JSObjectCallAsFunction + 376\\n18 TitaniumKit0x00000001051a1590 -[KrollCallback call:thisObject:] + 572\\n19 TitaniumKit0x00000001051a9b90 -[KrollEvent invoke:] + 112\\n20 TitaniumKit0x00000001051a9ecc -[KrollContext invoke:] + 116\\n21 TitaniumKit0x00000001051a9f3c -[KrollContext enqueue:] + 92\\n22 TitaniumKit0x00000001051737d4 -[KrollBridge fireEvent:withObject:remove:thisObject:] + 156\";\r\n[ERROR] : sourceURL = \"file:///private/var/containers/Bundle/Application/0B50635C-B65E-4E59-973E-D0B31DEC51F9/TestNEW.app/alloy.js\";\r\n[ERROR] : stack = \" at [native code]\\n at (/alloy.js:230:35)\\n at create(/alloy/controllers/BaseController.js:265:23)\\n at callbackInsertImage(/alloy/controllers/index.js:207:1223)\\n at success(/media2.js:22:9)\";\r\n[ERROR] : toJSON = \"\";\r\n[ERROR] : }{color}\r\n\r\nIf instead of $.UI.create you wrote:\r\n\r\n{code:java}\r\nvar vista = Ti.UI.createView({\r\n \theight: '95',\r\n\twidth: \"95\",\r\n\tleft:'5'\r\n});\r\nvar image = Ti.UI.createImageView({\r\n\theight:'95',\r\n\twidth:'95',\r\n\timage: blob\r\n});\r\n{code}\r\n\r\nEverything works fine, I'm using $.UI.create everywhere since I use the \"classes\" property.\r\n", "attachment": [], "flagged": false, "summary": "iOS: Create an ImageView with $.UI.create crash iOS app", "creator": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "environment": "Mac OSX Mojave 10.14.6 \r\nSDK 8.2.1", "comment": { "comments": [ { "id": "453293", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~Pietro], Could you please share a doc link where you see to use like this \"$.UI.create \"?\r\n\r\nThanks!", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-23T17:46:55.000+0000", "updated": "2019-12-23T17:46:55.000+0000" }, { "id": "453300", "author": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "body": "Sure @morahman , you can find it by searching \"dynamic tss\" like that wiki.\r\nhttps://wiki.appcelerator.org/display/guides2/Dynamic+Styles", "updateAuthor": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "created": "2019-12-24T08:28:36.000+0000", "updated": "2019-12-24T08:28:36.000+0000" }, { "id": "453303", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~Pietro] I was able to reproduce this issue. So I will move it to TiMOB for further investigation. We appreciate your help.", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-24T15:49:02.000+0000", "updated": "2019-12-24T15:49:02.000+0000" }, { "id": "453335", "author": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "body": "@Motiur Rahman thanks", "updateAuthor": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "created": "2019-12-30T09:27:54.000+0000", "updated": "2019-12-30T09:27:54.000+0000" }, { "id": "453422", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is it working fine with any previous SDK?", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-02T15:58:49.000+0000", "updated": "2020-01-02T15:58:49.000+0000" }, { "id": "453822", "author": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "body": "Yeah but I need to update it, in fact I saw that also with button it doesn't work anymore", "updateAuthor": { "name": "Pietro", "key": "pietro", "displayName": "Pietro Granati", "active": true, "timeZone": "Europe/Rome" }, "created": "2020-01-27T16:14:59.000+0000", "updated": "2020-01-27T16:14:59.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }