【已解决】(class file version 53.0), this version of the Java Runtime only recognizes class file

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

运行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

排查步骤:

  1. 查看本机安装的jdk是否有多个
  2. 检查环境版本是否一致(java -version、javac -version)
  3. 检查编译器设置的jdk和jre是否和环境变量一致
  4. Android SDK Build-tools版本过高(我卸载30,重新安装了26的,再重启appium就可以了)
    在这里插入图片描述
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

up up!

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值