I am getting an error while executing appium java script on Realme C1, Android 9.0 mobile device. but the same script running fine on Lenovo , Android 5.1.1 mobile device.
following is error
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: Error executing adbExec. Original error: ‘Command ‘C:\Users\win10\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s b990d528 shell settings delete global hidden_api_policy_pre_p_apps’ exited with code 255’; Stderr: '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:2028)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1093)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1076)
at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:666)
at android.content.ContentProvider$Transport.delete(ContentProvider.java:408)
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)
The same error happens to me but with Xiaomi device, and I can’t find ‘Disable Permission Monitoring’ in my device. Does anyone know the same option in Xiaomi device?
Thku sir its working. i m @Sandeep_Duve facing some other error. Can you have a solution on it. Need a +ve response.
[ADB] Using ‘apksigner.jar’ from ‘C:\Users\jeebu\AppData\Local\Android\Sdk\build-tools\30.0.2\lib\apksigner.jar’
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 shell am force-stop com.colouros.calculator’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 forward --remove tcp:8200’
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1606934184300 (00:06:24 GMT+0530 (India Standard Time))
[debug] [W3C] Encountered internal error running command: Error: Cannot verify the signature of ‘C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.15.0.apk’. Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly
[debug] [W3C] at ADB.checkApkCert (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-signing.js:267:11)
[debug] [W3C] at UiAutomator2Server.installServerApk (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:94:13)
[debug] [W3C] at AndroidUiautomator2Driver.initUiAutomator2Server (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:484:7)
[debug] [W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:379:5)
[debug] [W3C] at AndroidUiautomator2Driver.createSession (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:224:7)
[debug] [W3C] at AppiumDriver.createSession (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\lib\appium.js:366:35)
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 6036 ms - 1123
Hi Rajeev,
Today i got same error ,could you plz tell me , what is the problem and how to slove this [quote=“Rajeev_singh1, post:9, topic:29904, full:true”]
Thku sir its working. i m @Sandeep_Duve facing some other error. Can you have a solution on it. Need a +ve response.
[ADB] Using ‘apksigner.jar’ from ‘C:\Users\jeebu\AppData\Local\Android\Sdk\build-tools\30.0.2\lib\apksigner.jar’
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 shell am force-stop com.colouros.calculator’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 forward --remove tcp:8200’
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running ‘C:\Users\jeebu\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s d6abca80 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1606934184300 (00:06:24 GMT+0530 (India Standard Time))
[debug] [W3C] Encountered internal error running command: Error: Cannot verify the signature of ‘C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.15.0.apk’. Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly
[debug] [W3C] at ADB.checkApkCert (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-signing.js:267:11)
[debug] [W3C] at UiAutomator2Server.installServerApk (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:94:13)
[debug] [W3C] at AndroidUiautomator2Driver.initUiAutomator2Server (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:484:7)
[debug] [W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:379:5)
[debug] [W3C] at AndroidUiautomator2Driver.createSession (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:224:7)
[debug] [W3C] at AppiumDriver.createSession (C:\Users\jeebu\AppData\Roaming\npm\node_modules\appium\lib\appium.js:366:35)
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 6036 ms - 1123
[/quote]
Hi , i am getting this error , what is the problem and how to slove this , could you plz tell me
Hi… i am getting the below error in my console. But i do not have the " Disable Permission Monitoring" in my developer options. I am using motog60. Please help…
Exception in thread “main” 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: Cannot verify the signature of ‘C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’. Original error: Could not find ‘apksigner.jar’ in [“C:\androidSDK\platform-tools\apksigner.jar”,“C:\androidSDK\emulator\apksigner.jar”,“C:\androidSDK\cmdline-tools\latest\bin\apksigner.jar”,“C:\androidSDK\tools\apksigner.jar”,“C:\androidSDK\tools\bin\apksigner.jar”,“C:\androidSDK\apksigner.jar”]. Do you have Android Build Tools installed at ‘C:\androidSDK’?
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-INVAGO3’, ip: ‘192.168.29.28’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘18.0.2.1’
Driver info: driver.version: AppiumDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of ‘C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’. Original error: Could not find ‘apksigner.jar’ in [“C:\androidSDK\platform-tools\apksigner.jar”,“C:\androidSDK\emulator\apksigner.jar”,“C:\androidSDK\cmdline-tools\latest\bin\apksigner.jar”,“C:\androidSDK\tools\apksigner.jar”,“C:\androidSDK\tools\bin\apksigner.jar”,“C:\androidSDK\apksigner.jar”]. Do you have Android Build Tools installed at ‘C:\androidSDK’?
at getResponseForW3CError (C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-INVAGO3’, ip: ‘192.168.29.28’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘18.0.2.1’
Driver info: driver.version: AppiumDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:98)
at Appium.FirstProject.CalculatorTest.openCalculator(CalculatorTest.java:36)
at Appium.FirstProject.CalculatorTest.main(CalculatorTest.java:18)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
… 13 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of ‘C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’. Original error: Could not find ‘apksigner.jar’ in [“C:\androidSDK\platform-tools\apksigner.jar”,“C:\androidSDK\emulator\apksigner.jar”,“C:\androidSDK\cmdline-tools\latest\bin\apksigner.jar”,“C:\androidSDK\tools\apksigner.jar”,“C:\androidSDK\tools\bin\apksigner.jar”,“C:\androidSDK\apksigner.jar”]. Do you have Android Build Tools installed at ‘C:\androidSDK’?
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘DESKTOP-INVAGO3’, ip: ‘192.168.29.28’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘18.0.2.1’
Driver info: driver.version: AppiumDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of ‘C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’. Original error: Could not find ‘apksigner.jar’ in [“C:\androidSDK\platform-tools\apksigner.jar”,“C:\androidSDK\emulator\apksigner.jar”,“C:\androidSDK\cmdline-tools\latest\bin\apksigner.jar”,“C:\androidSDK\tools\apksigner.jar”,“C:\androidSDK\tools\bin\apksigner.jar”,“C:\androidSDK\apksigner.jar”]. Do you have Android Build Tools installed at ‘C:\androidSDK’?
at getResponseForW3CError (C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\Faiz Khan\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1002)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
… 15 more