Android test not running

Problem Statement:

I am running katalon version 9 and appium version 2. I am trying to execute the sample android project but it is giving me an error as mentioned below. also it is not recording the test aswell gives the same error. I have tried multiple solution but no help. Kindly help me resolve this issue.
The real android device is also connected and is in debuging mode.

Error:
=============== ROOT CAUSE =====================

Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Check Realme 3 Pro : Error : java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS · Issue #13802 · appium/appium · GitHub for throubleshooting. Error executing adbExec. Original error: ‘Command ‘‘C:\Users\Hamza Ahmad\.katalon\tools\android_sdk\platform-tools\adb.exe’ -P 5037 -s P7GUTWBY6HDAVW49 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’ exited with code 255’; Command output: Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

05-28-2024 04:56:53 PM Test Cases/Verify Correct Alarm Message

Elapsed time: 16.837s

Test Cases/Verify Correct Alarm Message FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Unable to start app at: ‘C:\Users\Hamza Ahmad\Katalon Studio\testin2\androidapp\APIDemos.apk’

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:38)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)

at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:63)

at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:42)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:78)

at Verify Correct Alarm Message.run(Verify Correct Alarm Message:14)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:137)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:128)

at TempTestCase1716897405057.run(TempTestCase1716897405057.groovy:25)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Check Realme 3 Pro : Error : java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS · Issue #13802 · appium/appium · GitHub for throubleshooting. Error executing adbExec. Original error: ‘Command ‘‘C:\Users\Hamza Ahmad\.katalon\tools\android_sdk\platform-tools\adb.exe’ -P 5037 -s P7GUTWBY6HDAVW49 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’ exited with code 255’; Command output: Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2041)

at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1104)

at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1087)

at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:669)

at android.content.ContentProvider$Transport.delete(ContentProvider.java:404)

at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:406)

at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:289)

at android.os.ShellCommand.exec(ShellCommand.java:103)

at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:51)

at android.os.Binder.shellCommand(Binder.java:634)

at android.os.Binder.onTransact(Binder.java:532)

at android.os.Binder.execTransact(Binder.java:731)

Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2041)

at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1104)

at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1087)

at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:669)

at android.content.ContentProvider$Transport.delete(ContentProvider.java:404)

at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:406)

at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:289)

at android.os.ShellCommand.exec(ShellCommand.java:103)

at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:51)

at android.os.Binder.shellCommand(Binder.java:634)

at android.os.Binder.onTransact(Binder.java:532)

at android.os.Binder.execTransact(Binder.java:731)

Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2041)

at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1104)

at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1087)

at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:669)

at android.content.ContentProvider$Transport.delete(ContentProvider.java:404)

at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:406)

at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:289)

at android.os.ShellCommand.exec(ShellCommand.java:103)

at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:51)

at android.os.Binder.shellCommand(Binder.java:634)

at android.os.Binder.onTransact(Binder.java:532)

at android.os.Binder.execTransact(Binder.java:731)

Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’

System info: host: ‘HAMZAAHMAD-984’, ip: ‘172.28.2.213’, os.name: ‘Windows 11’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.7’

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Hi @hamza.ahmad. On some android devices there is another settings on top of the required “USB Debugging” setting that you have to change in order to use appium on your device. The setting should be “Disable Permission Monitoring” which you can either search or it should be at the bottom of the developer settings page.