Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run script in Appium #416

Open
alkadalakoti opened this issue Feb 23, 2021 · 11 comments
Open

Not able to run script in Appium #416

alkadalakoti opened this issue Feb 23, 2021 · 11 comments

Comments

@alkadalakoti
Copy link

@mykola-mokhnach
I m not able to run script getting this error
java.lang.reflect.InvocationTargetException
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: You must include a platformName capability (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 174 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-QAGK3G7', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: AppiumDriver
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-QAGK3G7', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: AppiumDriver
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: You must include a platformName capability (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 174 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-QAGK3G7', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: AppiumDriver
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-QAGK3G7', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: AppiumDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:216)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:225)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:247)
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:338)
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:89)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:99)
at Appiumtest.calculatortest.opencalculator(calculatortest.java:36)
at Appiumtest.calculatortest.main(calculatortest.java:19)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:193)
... 13 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: You must include a platformName capability (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 174 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-QAGK3G7', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: AppiumDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
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.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
... 18 more
Please help

@shivakrishnach31
Copy link

@alkadalakoti - As per the Appium server log, it seems you didn't mention the "platformName" capability. Add it to your desired capabilities and try. It's 'Android' for Android, 'iOS' for iOS platforms. Thank you.

@alkadalakoti
Copy link
Author

alkadalakoti commented Feb 23, 2021 via email

@shivakrishnach31
Copy link

It should be platformName and platformVersion. Not plateformName and plateformVersion. There are typos in these two caps.

@alkadalakoti
Copy link
Author

hi ...how to correct these errors
C:\Users\alka\AppData\Local\Temp\2021123-7576-11eduy8.chz4\appium-uiautomator2-server-v4.17.4.apk'. Original error: Could not find
'apksigner.jar' in ["C:\Program Files\Android\Android Studio\platform-tools\apksigner.jar",
"C:\Program Files\Android\Android Studio\emulator
\Program Files\Android\Android Studio\cmdline-tools\latest\bin\apksigner.jar","C:\Program File
s\Android\Android Studio\tools\apksigner.jar","C:\Program Files\Android\Android Studio\tools\bin\a
pksigner.jar","C:\Program Files\Android\Android Studio\apksigner.jar"]. Do you have Android Build Tools installed at 'C:\Program Files\Android\Android Studio'?

I m not able to find apksigner.jar file even in internet.

@KazuCocoa
Copy link
Member

What version of Android SDK build tools do you have?
Afaik, the apksigner is in the build tools 24+, so currently we require build tools 24+ at least.
http://appium.io/docs/en/drivers/android-uiautomator2/#requirements-and-support

@alkadalakoti
Copy link
Author

An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.sec.android.app.popupcalculator' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Cannot start the 'com.sec.android.app.popupcalculator' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.com.sec.android.app.popupcalculator.calculator' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

how to do this?

@KazuCocoa
Copy link
Member

@Anant6862
Copy link

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 start the 'com.wayfinder.app.lucknow' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\HI\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52M519PBHZ shell am start -W -n com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output:
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity } from null (pid=9401, uid=2000) not exported from uid 10618
at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1344)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1260)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:894)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1962)
at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:4536)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:564)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:192)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:13117)
at android.os.Binder.shellCommand(Binder.java:965)
at android.os.Binder.onTransact(Binder.java:839)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6026)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3628)
at android.os.Binder.execTransactInternal(Binder.java:1195)
at android.os.Binder.execTransact(Binder.java:1159)

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-8ELVUAA', ip: '192.168.1.155', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2'
Driver info: driver.version: AppiumDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.wayfinder.app.lucknow' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\HI\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52M519PBHZ shell am start -W -n com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output:
Exception occurred while executing 'start':

@Anant6862
Copy link

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 start the 'com.wayfinder.app.lucknow' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\HI\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52M519PBHZ shell am start -W -n com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output: Exception occurred while executing 'start': java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity } from null (pid=9401, uid=2000) not exported from uid 10618 at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1344) at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1260) at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:894) at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1962) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:4536) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:564) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:192) at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98) at android.os.ShellCommand.exec(ShellCommand.java:44) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:13117) at android.os.Binder.shellCommand(Binder.java:965) at android.os.Binder.onTransact(Binder.java:839) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6026) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3628) at android.os.Binder.execTransactInternal(Binder.java:1195) at android.os.Binder.execTransact(Binder.java:1159)

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DESKTOP-8ELVUAA', ip: '192.168.1.155', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2' Driver info: driver.version: AppiumDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.wayfinder.app.lucknow' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\HI\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52M519PBHZ shell am start -W -n com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output: Exception occurred while executing 'start':

please help me to solve this error

@KazuCocoa
Copy link
Member

Did the activity expect to start? Usually, you can start an activity that has android:exported="true" only.
If it was selected by Appium automatically, you should figure out exported activity by manual as appActivity capability

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.wayfinder.app.lucknow/com.example.kioskconfig.home.HomeActivity } from null (pid=9401, uid=2000) not exported from uid 10618

@vickypandiyan
Copy link

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 400. Message: 'platformName' android not part of fake,android,ios,tvos,windows,mac,tizen,linux,roku,webos
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'DESKTOP-QUTGMCC', ip: '192.168.1.12', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '18.0.1.1'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [null, newSession {capabilities=[{appium:appActivity=org.chromium.chrome.browser.ChromeTabbedActivity, appium:appPackage=com.android.chrome, appium:deviceName=pixel_4, platformName= Android, appium:platformVersion=7.0, appium:udid=emulator-5554}], desiredCapabilities=Capabilities {appActivity: org.chromium.chrome.browser..., appPackage: com.android.chrome, deviceName: pixel_4, platformName: Android, platformVersion: 7.0, udid: emulator-5554}}]
Capabilities {}
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:126)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:146)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:225)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:151)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:79)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:87)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:116)
at experience.com.Appium.Google.main(Google.java:22)
Screenshot (560)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants