appium+Andriod環境搭建遇到問題
報錯:Caused by: org.openqa.selenium.WebDriverException: 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.21.1.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
原因:安裝android sdk時bulid-tools版本30以上和jdk1.8的不匹配,所以需要將bulid-tools版本降為30以下的
安裝Android Studio開發工具,在該工具裡安裝android sdk,降低版本的方法:
步驟1:
啟動Android Studio,點選Configrue
步驟2,選擇SDK Manager
步驟3:選擇SDK Tools 選擇build-tools勾選Show Package detill
步驟4:選擇自己需要的版本