honeynet/droidbot

AttributeError: 'NoneType' object has no attribute 'get_possible_input'

husam88 opened this issue · 2 comments

I got this issue while running Droidbot using google nexus5 emulator and google API19 KitKat 4.4).
WARNING:Device:Failed to get views using Accessibility.
WARNING:Device:failed to get current views!
WARNING:Device:exception in get_current_state: list index out of range
Traceback (most recent call last):
File "/home/husam/env1/droidbot-gym-modified/droidbot/device.py", line 816, in get_current_state
screenshot_path=screenshot_path)
File "/home/husam/env1/droidbot-gym-modified/droidbot/device_state.py", line 27, in init
self.__assemble_view_tree(self.view_tree, self.views)
File "/home/husam/env1/droidbot-gym-modified/droidbot/device_state.py", line 64, in __assemble_view_tree
self.view_tree = copy.deepcopy(views[0])
IndexError: list index out of range
WARNING:Device:Failed to get current state!
Traceback (most recent call last):
File "start_gym_env_q_learning_modified.py", line 354, in
main()
File "start_gym_env_q_learning_modified.py", line 321, in main
env.step([make_action])
File "/home/husam/env1/lib/python3.5/site-packages/stable_baselines/common/vec_env/base_vec_env.py", line 134, in step
return self.step_wait()
File "/home/husam/env1/lib/python3.5/site-packages/stable_baselines/common/vec_env/dummy_vec_env.py", line 40, in step_wait
self.envs[env_idx].step(self.actions[env_idx])
File "/home/husam/env1/droidbot-gym-modified/droidbot/droidbot_env.py", line 87, in step
self.set_possible_events()
File "/home/husam/env1/droidbot-gym-modified/droidbot/droidbot_env.py", line 133, in set_possible_events
events = state.get_possible_input()
AttributeError: 'NoneType' object has no attribute 'get_possible_input'
my target is to use Android KitKAT

Hi @husam88 ,
Are you using the code in the master branch? Can you please also post your command line here?

hi @ylimit
I'm working on a new input generation policy.
I got the above issue.

Also, I'm facing this issue when I run the original droidbot on most of (f-droid repository) apps.
I used : droidbot -a <path_to_apk> -o output_dir
by using: Android emulator API19 kitkat.

APK: https://f-droid.org/en/packages/com.evancharlton.mileage/

I'm getting this error.
INFO:Device:disable minicap on emulator
INFO:DroidBot:Starting DroidBot
INFO:Device:waiting for device
Traceback (most recent call last):
File "/home/husam/Desktop/env10/env10/droidbot/droidbot/adapter/droidbot_app.py", line 140, in listen_messages
_, _, message_len = self.read_head()
File "/home/husam/Desktop/env10/env10/droidbot/droidbot/adapter/droidbot_app.py", line 131, in read_head
header = self.sock_read(DROIDBOT_APP_PACKET_HEAD_LEN)
File "/home/husam/Desktop/env10/env10/droidbot/droidbot/adapter/droidbot_app.py", line 122, in sock_read
raise EOF()
EOF

Droidbot is not able to start any of my App's under test.
Screenshot from 2019-08-21 15-48-09