习惯性伸手党区 hasInternetPermissionFromManifest failed

kthh · 2014年08月28日 · 最后由 wfp 回复于 2016年09月22日 · 1035 次阅读

desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.1'

desired_caps['automationName'] = 'Selendroid'

self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
以上为基本信息的一部分(真机测试),报错为:
Error
Traceback (most recent call last):
File "/home/yinchuan/PycharmProjects/SpiderMan/sample-code-master/sample-code/examples/python/android_contacts.py", line 27, in setUp
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "/usr/local/lib/python2.7/dist-packages/appium/webdriver/webdriver.py", line 35, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 73, in init
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: u'A new session could not be created. (Original error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging \nERROR: no dump file specified\n)'
请问这是什么原因?为什么 hasInternetPermissionFromManifest failed

还有这个信息:
debug: Starting logcat capture
debug: Checking whether aapt is present
debug: Using aapt from /opt/adt-sdk/sdk/build-tools/android-4.4W/aapt
debug: hasInternetPermissionFromManifest: "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
warn: ERROR: no dump file specified

debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
ERROR: no dump file specified

debug: Error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
ERROR: no dump file specified

共收到 4 条回复 时间 点赞

你是不是没有设置 app,使用的是 appActivity,appPackage 这种方式启动的吗?我也遇到这个问题了。改成用 app 的试,就可以解决这个问题了。

kthh #2 · 2014年12月02日 Author

#1 楼 @yivanus 谢谢,当时刚学习,是这个问题

#2 楼 @kthh7 我也遇到这个问题了,请问怎么用 app 的???

#1 楼 @yivanus 我也遇到这个问题了,请问怎么改用 app 的试???

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册