• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Permission Error

Vikere

Lurker
Oct 23, 2017
3
0
Hello,

I am quite new to Android app development. I had a Window app developed on Qt for serial port. I cross-compiled it for Android phone. It successfully build and run on Android Phone as well, but when I try to connect to the available serial Port I got an error saying - "Permission Error: Unable to create Lock file." I cross verified with other available Google Play store app for serial port, it is working fine with it.

I tried google for similar issue, I got some reference but unable to fix the issue. Please let me know if anyone have simpler & straightforward way of fixing it.

Thanks
 
Code:
10-24 01:39:11.883 505-520/? D/ConnectivityService: getActiveNetworkInfo:NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "VikMeg_222016", roaming: false, failover: false, isAvailable: true, simId: 0/10013
10-24 01:39:14.514 505-862/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity} from pid 788
10-24 01:39:14.515 505-862/? V/ActivityManager: At 16 ckp TaskRecord{422cdf40 #51 A org.qtproject.example.ILA_APP U 0}: ActivityRecord{42baa0e0 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity}
10-24 01:39:14.681 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Changes: creating=false format=false size=false visible=true left=false top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceSizeChanged=false mVisible=false mRequestedVisible=true
10-24 01:39:14.681 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Cur surface: Surface(name=null, identity=-1)
10-24 01:39:14.686 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: New surface: Surface(name=null, identity=677), vis=true, frame=Rect(0, 50 - 720, 1280)
10-24 01:39:14.686 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: visibleChanged -- surfaceCreated
10-24 01:39:14.686 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: surfaceChanged -- format=1 w=720 h=1230
10-24 01:39:14.686 25700-25700/org.qtproject.example.ILA_APP V/SurfaceView: Layout: x=0 y=50 w=720 h=1230, frame=Rect(0, 0 - 720, 1230)
10-24 01:39:14.687 481-482/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:0) setConsumerName: org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity
10-24 01:39:14.689 505-869/? V/WindowManager: Changing focus from null to Window{4260fe60 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity}
10-24 01:39:14.692 505-522/? I/WindowManager: Gaining focus: Window{4260fe60 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity}
10-24 01:39:14.692 481-12594/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:0) connect: api=1
10-24 01:39:14.693 481-12594/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:1) setSynchronousMode: enabled=1
10-24 01:39:14.693 481-12610/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:1) setSynchronousMode: enabled=1
10-24 01:39:14.695 481-12026/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:1) new GraphicBuffer needed
10-24 01:39:14.706 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Changes: creating=false format=false size=false visible=false left=false top=false mUpdateWindowNeeded=false mReportDrawNeeded=true redrawNeeded=false forceSizeChanged=false mVisible=true mRequestedVisible=true
10-24 01:39:14.706 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Cur surface: Surface(name=null, identity=677)
10-24 01:39:14.709 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: New surface: Surface(name=null, identity=677), vis=true, frame=Rect(0, 50 - 720, 1280)
10-24 01:39:14.710 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: surfaceRedrawNeeded
10-24 01:39:14.710 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: finishedDrawing
10-24 01:39:14.712 25700-25700/org.qtproject.example.ILA_APP V/SurfaceView: Layout: x=0 y=50 w=720 h=1230, frame=Rect(0, 0 - 720, 1230)
10-24 01:39:14.714 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Changes: creating=false format=false size=false visible=true left=false top=false mUpdateWindowNeeded=false mReportDrawNeeded=true redrawNeeded=false forceSizeChanged=false mVisible=true mRequestedVisible=false
10-24 01:39:14.714 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Cur surface: Surface(name=null, identity=677)
10-24 01:39:14.718 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: New surface: Surface(name=null, identity=-1), vis=false, frame=Rect(0, 50 - 720, 1280)
10-24 01:39:14.718 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: visibleChanged -- surfaceDestroyed
10-24 01:39:14.718 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: finishedDrawing
10-24 01:39:14.719 25700-25700/org.qtproject.example.ILA_APP V/SurfaceView: Layout: x=0 y=50 w=720 h=1230, frame=Rect(0, 0 - 720, 1230)
10-24 01:39:14.725 25700-25700/org.qtproject.example.ILA_APP V/InputMethodManager: onWindowFocus: null softInputMode=288 first=true flags=#1810100
10-24 01:39:14.725 25700-25700/org.qtproject.example.ILA_APP V/InputMethodManager: START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{41e529b8 V.E..... R.....ID 0,0-720,1280} ic=null tba=android.view.inputmethod.EditorInfo@421b2a48 controlFlags=#104
10-24 01:39:14.727 25700-25700/org.qtproject.example.ILA_APP V/InputMethodManager: Starting input: Bind result=InputBindResult{com.android.internal.view.IInputMethodSession$Stub$Proxy@421b32e8 com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME #438}
10-24 01:39:14.731 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Changes: creating=true format=true size=true visible=true left=true top=true mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceSizeChanged=true mVisible=false mRequestedVisible=true
10-24 01:39:14.732 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Cur surface: Surface(name=null, identity=-1)
10-24 01:39:14.737 25700-25713/org.qtproject.example.ILA_APP W/ResourceType: No package identifier when getting name for resource number 0x00000005
10-24 01:39:14.738 25700-25713/org.qtproject.example.ILA_APP V/SurfaceView: org.qtproject.qt5.android.QtSurface{421b0ce8 V.E..... ......ID 0,0-720,1230 #5} got resized: w=720 h=1230, cur w=-1 h=-1
10-24 01:39:14.740 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: New surface: Surface(name=null, identity=679), vis=true, frame=Rect(0, 50 - 720, 1280)
10-24 01:39:14.740 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: visibleChanged -- surfaceCreated
10-24 01:39:14.740 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: surfaceChanged -- format=1 w=720 h=1230
10-24 01:39:14.740 25700-25705/org.qtproject.example.ILA_APP D/dalvikvm: GC_CONCURRENT freed 2014K (14036), 34% free 4247K/6372K, paused 2ms+2ms, total 19ms
10-24 01:39:14.740 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: surfaceRedrawNeeded
10-24 01:39:14.740 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: finishedDrawing
10-24 01:39:14.749 25700-25700/org.qtproject.example.ILA_APP V/SurfaceView: Layout: x=0 y=50 w=720 h=1230, frame=Rect(0, 0 - 720, 1230)
10-24 01:39:14.755 481-12870/? I/BufferQueue: [org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity](this:0x4223c860,api:1) new GraphicBuffer needed
10-24 01:39:14.783 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Changes: creating=false format=false size=false visible=false left=false top=false mUpdateWindowNeeded=true mReportDrawNeeded=true redrawNeeded=false forceSizeChanged=false mVisible=true mRequestedVisible=true
10-24 01:39:14.783 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: Cur surface: Surface(name=null, identity=679)
10-24 01:39:14.786 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: New surface: Surface(name=null, identity=679), vis=true, frame=Rect(0, 50 - 720, 1280)
10-24 01:39:14.786 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: surfaceRedrawNeeded
10-24 01:39:14.787 25700-25700/org.qtproject.example.ILA_APP I/SurfaceView: finishedDrawing
10-24 01:39:14.788 25700-25700/org.qtproject.example.ILA_APP V/SurfaceView: Layout: x=0 y=50 w=720 h=1230, frame=Rect(0, 0 - 720, 1230)
10-24 01:39:14.788 505-780/? V/ActivityManager: Activity idle: Token{42683078 ActivityRecord{42baa0e0 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity}}
10-24 01:39:15.103 505-522/? D/ActivityManager: ACT-IDLE_NOW_MSG from windowsVisible() for idle: ActivityRecord{42baa0e0 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity}
10-24 01:39:20.474 505-1520/? D/ConnectivityService: getActiveNetworkInfo:NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "VikMeg_222016", roaming: false, failover: false, isAvailable: true, simId: 0/10013
10-24 01:39:23.713 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)): The following directories are not readable or writable for detaling with lock files
10-24 01:39:23.715 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /var/lock
10-24 01:39:23.715 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /etc/locks
10-24 01:39:23.716 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /var/spool/locks
10-24 01:39:23.716 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /var/spool/uucp
10-24 01:39:23.717 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /tmp
10-24 01:39:23.717 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /var/tmp
10-24 01:39:23.718 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /var/lock/lockdev
10-24 01:39:23.718 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /run/lock
10-24 01:39:23.719 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)):     /data/local/tmp
10-24 01:39:23.719 25700-25714/org.qtproject.example.ILA_APP W/libILA_APP.so: (null):0 ((null)): Failed to create a lock file for opening the device
10-24 01:39:23.736 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.744 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.755 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.757 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.761 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.792 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.795 25700-25700/org.qtproject.example.ILA_APP D/skia: Flag is not 10
10-24 01:39:23.798 505-865/? V/WindowManager: Changing focus from Window{4260fe60 u0 org.qtproject.example.ILA_APP/org.qtproject.qt5.android.bindings.QtActivity} to Window{422d5fe0 u0 Error}
10-24 01:39:41.894 505-520/? D/ConnectivityService: getActiveNetworkInfo:NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: "VikMeg_222016", roaming: false, failover: false, isAvailable: true, simId: 0/10013
 
Upvote 0
Sorry but it's difficult to answer this question because we haven't seen any of your code.
The way to systematically approach this problem, is to run your app in debug mode, and set breakpoints in the code, around the place where you're trying to open the serial port. Then step through line by line, and see what happens.
If we could have a look at the code, we could possibly advise further.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones