运行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就可以了)