{ "id": "159758", "key": "AC-3534", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2016-05-03T19:12:30.000+0000", "created": "2016-04-21T08:01:55.000+0000", "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-03T19:12:30.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "My app works perfectly on Android under version 6, but on Android 6 this error appear when the app starts:\r\n\r\nIt seems that si a problem in libraries or something like this.\r\n\r\nDevice: Huawei P8\r\n\r\n{code:java}\r\n[ERROR] : linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]\r\n[INFO] : TiApplication: (main) [0,0] checkpoint, app created.\r\n[INFO] : TiApplication: (main) [116,116] Titanium 5.2.2 (2016/03/28 14:12 b685ddb)\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/system/lib/hw/gralloc.hi3635.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"libion.so\". Will use given name.\r\n[ERROR] : HAL: load: id=gralloc != hmi->id=gralloc\r\n[INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default ''\r\n[INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default ''\r\n[INFO] : TiApplication: (main) [153,269] Titanium Javascript runtime: v8\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libstlport_shared.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libkroll-v8.so\". Will use given name.\r\n[INFO] : HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\r\n[WARN] : V8Object: (KrollRuntimeThread) [64,64] Runtime disposed, cannot set property 'userAgent'\r\n[WARN] : TiTempFileHelper: (main) [17,81] The external temp directory doesn't exist, skipping cleanup\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libanalytics.google.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libti.map.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libes.epi.comscore.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libcom.rkam.swiperefreshlayout.so\". Will use given name.\r\n[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]\r\n[ERROR] : linker: warning: unable to get realpath for the library \"/data/app/es.epi.emporda-1/lib/arm/libfacebook.so\". Will use given name.\r\n[ERROR] : TiApplication: (KrollRuntimeThread) [48,129] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/es.epi.emporda-1/lib/arm/libfacebook.so: has text relocations; Titanium 5.2.2,2016/03/28 14:12,b685ddb\r\n[ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/es.epi.emporda-1/lib/arm/libfacebook.so: has text relocations\r\n[ERROR] : TiApplication: \tat java.lang.Runtime.loadLibrary(Runtime.java:384)\r\n[ERROR] : TiApplication: \tat java.lang.System.loadLibrary(System.java:1086)\r\n[ERROR] : TiApplication: \tat org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)\r\n[ERROR] : TiApplication: \tat org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)\r\n[ERROR] : TiApplication: \tat org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205)\r\n[ERROR] : TiApplication: \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android 6 - Crash when app starts", "creator": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.11.4\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 4294967296\r\nNode.js\r\n Node.js Version = 0.12.7\r\n npm Version = 2.11.3\r\nTitanium CLI\r\n CLI Version = 5.0.6\r\nTitanium SDK\r\n SDK Version = 5.2.2.GA\r\n SDK Path = /Users/amurcia/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA\r\n Target Platform = android", "comment": { "comments": [ { "id": "383500", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nIt's the runtime permission issue of Android 6. Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. So if you need any permission that is grouped in \"Dangerous Permission\" you will need to ask that permission first and get granted. Most common permissions are \"Camera\" and \"External Storage\", \"Location\" etc. Please figure out what permission do you need in your project and ask that permission first before launching tasks. Here is an example of how camera permission is asked in appelerator.\r\n{code}\r\nif (Ti.Media.hasCameraPermissions()) {\r\n\treturn alert('You already have permission.');\r\n} else {\r\n\r\n\tTi.Media.requestCameraPermissions(function(e) {\r\n\t\tif (e.success) {\r\n\t\t\talert('You were granted permission.');\r\n\t\t} else {\r\n\t\t\talert('ou were denied permission for now, forever or the dialog did not show at all because it was denied forever before.');\r\n\t\t}\r\n\t});\r\n}\r\n{code}\r\nThanks\r\n\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-21T09:04:52.000+0000", "updated": "2016-04-21T09:04:52.000+0000" }, { "id": "383509", "author": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This cause that the app can't open???\r\n\r\nThis libs too?? libstlport_shared.so., libkroll-v8.so, libcom.rkam.swiperefreshlayout.so", "updateAuthor": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-21T09:48:12.000+0000", "updated": "2016-04-21T09:49:53.000+0000" }, { "id": "383528", "author": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "body": "In android 5, text relocations caused a warning.\r\nIn android 6, text relocations cause a halt.\r\n\r\nIt appears as though the version of the facebook module you are using was compiled with an older version of the NDK.\r\nThe module and its child libraries would need to be rebuilt with an updated NDK to remove the text relocations.", "updateAuthor": { "name": "sfeather", "key": "sfeather", "displayName": "Stephen Feather", "active": true, "timeZone": "America/New_York" }, "created": "2016-04-21T11:37:49.000+0000", "updated": "2016-04-21T11:37:49.000+0000" }, { "id": "383529", "author": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ok, thank you. I'm trying to solve it.", "updateAuthor": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-21T11:39:11.000+0000", "updated": "2016-04-21T11:39:11.000+0000" }, { "id": "383928", "author": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm using this function to solve the problem but the error still being the same:\r\n\r\n\r\n{code:java}\r\nexports.checkPermissions = function(){\r\n\t\r\n\tvar permissionsToRequest = [];\r\n\t \r\n\t// check WRITE_EXTERNAL_STORAGE permission\r\n\tvar storagePermission = \"android.permission.WRITE_EXTERNAL_STORAGE\";\r\n\tvar hasStoragePermission = Ti.Android.hasPermission(storagePermission);\r\n\t \r\n\tif(!hasStoragePermission){\r\n\t\tpermissionsToRequest.push(storagePermission);\r\n\t}\r\n\t \r\n\t// check ACCESS_COARSE_LOCATION permission\r\n\tvar locationPermission = \"android.permission.ACCESS_COARSE_LOCATION\";\r\n\tvar hasLocationPermission = Ti.Android.hasPermission(locationPermission);\r\n\t \r\n\tif(!hasLocationPermission){\r\n\t\tpermissionsToRequest.push(locationPermission);\r\n\t}\r\n\t\r\n\t// check ACCESS_FINE_LOCATION permission\r\n\tvar location2Permission = \"android.permission.ACCESS_FINE_LOCATION\";\r\n\tvar hasLocation2Permission = Ti.Android.hasPermission(location2Permission);\r\n\t \r\n\tif(!hasLocation2Permission){\r\n\t\tpermissionsToRequest.push(location2Permission);\r\n\t}\r\n\t \r\n\t// request permission\r\n\tTi.Android.requestPermissions(permissionsToRequest, function(e) {\r\n\t\tif (e.success) {\r\n\t\t\tTi.API.info(\"SUCCESS\");\r\n\t\t\tcallback();\r\n\t\t} else {\r\n\t\t\tTi.API.info(\"ERROR: \" + e.error);\r\n\t\t}\r\n\t});\t\r\n};\r\n{code}\r\n\t", "updateAuthor": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-26T14:25:34.000+0000", "updated": "2016-04-26T14:25:34.000+0000" }, { "id": "383930", "author": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The new error is: \r\n\r\n\r\n{code:java}\r\n[ERROR] : TiExceptionHandler: (main) [1,655] - Message: Uncaught TypeError: Object # has no method 'hasPermission'\r\n{code}\r\n", "updateAuthor": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-26T14:29:53.000+0000", "updated": "2016-04-26T14:29:53.000+0000" }, { "id": "384031", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~amurcia],\r\n\r\nYour are not requesting permission in right way. You can use ti.permission module for run-time permission.\r\n\r\n[Module Link|http://gitt.io/component/ti.permissions]\r\n\r\nThanks\r\n\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-27T05:36:50.000+0000", "updated": "2016-04-27T05:36:50.000+0000" }, { "id": "384035", "author": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This appear in the readme of this module:\r\n\r\nOTE (Implementation hints)\r\n\r\nAfter merging of PR #7778 the Appcelerator guys unfortunately decided to strip down the functionality of the implementation.\r\n\r\nSo there is no way to support this module with the current API anymore :-( Sorry for that!\r\n\r\nThe official API is now part of Ti.Android and can be used as follows:\r\n\r\n\r\n{code:java}\r\n // check permission\r\n\r\n var storagePermission = \"android.permission.READ_EXTERNAL_STORAGE\";\r\n var hasStoragePermission = Ti.Android.hasPermission(storagePermission);\r\n{code}\r\n\r\n\r\n{code:java}\r\n\r\n // request permission\r\n\r\n Ti.Android.requestPermissions(permissionsToRequest, function(e) {\r\n if (e.success) {\r\n Ti.API.info(\"SUCCESS\");\r\n } else {\r\n Ti.API.info(\"ERROR: \" + e.error);\r\n }\r\n });\r\n{code}\r\n", "updateAuthor": { "name": "amurcia", "key": "amurcia", "displayName": "Anna", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-27T06:24:29.000+0000", "updated": "2016-04-27T06:24:29.000+0000" }, { "id": "384065", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~amurcia],\r\n\r\n{{Ti.Android}} API can be used as mentioned with SDK 5.4.0 (Which is still in beta) or later. For earlier version you can used this module and the given example is like this.\r\n{code}\r\nvar tipermissions = require('ti.permissions'); // will return same instance as other require calls\r\n\r\n//Add behavior for UI\r\nlabel.addEventListener('click', function(e) {\r\n\t hasPerm = tipermissions.hasPermission(\"android.permission.CAMERA\");\r\n Ti.API.log(\"error\",\"Critical Permission \" + hasPerm);\r\n\r\n tipermissions.requestPermission(\"android.permission.CAMERA\",123,function(e) {\r\n Ti.API.log(\"error\",\"In callback \" + e.success + \" \" + e.code + \" \" + e.requestCode);\r\n });\r\n\r\n\t});\r\n{code}", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-04-27T10:57:47.000+0000", "updated": "2016-04-27T10:57:47.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }