Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path

写case写好好哒,突然debug的时候就冒出这个错误:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path.

 

检查了一圈,没有找到任何原因所在,突然想到刚刚下载了一个新版的platform-tools替换了该路径下(/Users/XXX/Library/Android/sdk/)原有的platform-tools文件夹,采取的是直接copy覆盖的方式……然后恢复到原来的文件夹依然还是报错不干活……使用 appium-doctor检查环境一切ok

后续再次检查了 ANDROID_HOME 及其他环境变量的配置,依然没错……

然后又检查了/Users/XXX/Library/Android/sdk/build-tools下只有一个API Level 27,后续又下载了Level28/26, 依旧failed……

 

解决方法:

1.重新用android studio更新了一遍sdk (因为当时配置环境的时候为了方便直接安装了android studio来获取一些东西)

2.然后把/Users/XXX/Library/Android/sdk/build-tools/27.0.3下的aapt.exe copy了一份到/Users/XXX/Library/Android/sdk/tools/下

 

然后就可以愉快的跑起来啦,当然,没搞懂为什么要这样操作一把……

猜想,会不会最近为了解决多个adb冲突,将adb指向airtest路径下,造成环境比较混乱……看来需要清理清理环境了……

 

 

posted @ 2019-03-28 17:15  HappyLeen  阅读(1521)  评论(0编辑  收藏  举报