运行testngxml文件报错
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 ‘/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.17.4.apk’. Original error: Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
排查步骤:
- 查看本机安装的jdk是否有多个
- 检查环境版本是否一致(java -version、javac -version)
- 检查编译器设置的jdk和jre是否和环境变量一致
- Android SDK Build-tools版本过高(我卸载30,重新安装了26的,再重启appium就可以了)


本文档描述了在尝试运行testng.xml文件时遇到的SessionNotCreatedException错误,该错误与Appium、Java版本不兼容以及AndroidSDKBuild-tools版本过高有关。解决方法包括检查并统一JDK版本,确保环境变量配置正确,以及降低AndroidSDKBuild-tools版本。通过这些步骤,成功解决了报错问题并重新启动Appium。
5470

被折叠的 条评论
为什么被折叠?



