[AC-3534] Android 6 - Crash when app starts
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2016-05-03T19:12:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | android |
Reporter | Anna |
Assignee | Shak Hossain |
Created | 2016-04-21T08:01:55.000+0000 |
Updated | 2016-05-03T19:12:30.000+0000 |
Description
My app works perfectly on Android under version 6, but on Android 6 this error appear when the app starts:
It seems that si a problem in libraries or something like this.
Device: Huawei P8
[ERROR] : linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]
[INFO] : TiApplication: (main) [0,0] checkpoint, app created.
[INFO] : TiApplication: (main) [116,116] Titanium 5.2.2 (2016/03/28 14:12 b685ddb)
[ERROR] : linker: warning: unable to get realpath for the library "/system/lib/hw/gralloc.hi3635.so". Will use given name.
[ERROR] : linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]
[ERROR] : linker: warning: unable to get realpath for the library "libion.so". Will use given name.
[ERROR] : HAL: load: id=gralloc != hmi->id=gralloc
[INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default ''
[INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default ''
[INFO] : TiApplication: (main) [153,269] Titanium Javascript runtime: v8
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[INFO] : HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[WARN] : V8Object: (KrollRuntimeThread) [64,64] Runtime disposed, cannot set property 'userAgent'
[WARN] : TiTempFileHelper: (main) [17,81] The external temp directory doesn't exist, skipping cleanup
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[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.
[ERROR] : linker: readlink('/proc/self/fd/26') failed: Permission denied [fd=26]
[ERROR] : linker: warning: unable to get realpath for the library "/data/app/es.epi.emporda-1/lib/arm/libfacebook.so". Will use given name.
[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
[ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/es.epi.emporda-1/lib/arm/libfacebook.so: has text relocations
[ERROR] : TiApplication: at java.lang.Runtime.loadLibrary(Runtime.java:384)
[ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:1086)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114)
Hello, It'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.
Thanks
This cause that the app can't open??? This libs too?? libstlport_shared.so., libkroll-v8.so, libcom.rkam.swiperefreshlayout.so
In android 5, text relocations caused a warning. In android 6, text relocations cause a halt. It appears as though the version of the facebook module you are using was compiled with an older version of the NDK. The module and its child libraries would need to be rebuilt with an updated NDK to remove the text relocations.
Ok, thank you. I'm trying to solve it.
I'm using this function to solve the problem but the error still being the same:
The new error is:
Hello [~amurcia], Your are not requesting permission in right way. You can use ti.permission module for run-time permission. [Module Link](http://gitt.io/component/ti.permissions) Thanks
This appear in the readme of this module: OTE (Implementation hints) After merging of PR #7778 the Appcelerator guys unfortunately decided to strip down the functionality of the implementation. So there is no way to support this module with the current API anymore :-( Sorry for that! The official API is now part of Ti.Android and can be used as follows:
Hello [~amurcia],
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.