AutoHotkey ImageSearch not detecting image - automation

I'm trying to make a bot with AutoHotkey to play a game called BTD6 for me.
The problem is that I need to detect when the victory screen appears, and click a button. So I tried using ImageSearch to search for the button inside a While loop, but the loop never ends.
I made the test script bellow and it works fine:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^b::
ImageSearch, ix, iy, 0, 0, A_ScreenWidth, A_ScreenHeight, next.png
Click, %ix% %iy%
Return
Escape::
ExitApp
Return
But when I put it in the main bot code, it does not work, I think it's because the loop never exits:
(scroll to the bottom of the code)
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode Pixel
^b::
While true {
Click, 1223 1553
Sleep, 1000
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 801 1097
Sleep, 1000
Click, 882 668
Sleep, 1000
Click, 1994 720
Sleep, 5000
Click, 1444 1265,
Sleep, 1000
Send {k down}{k up}
MouseMove, 2381, 1100, 20
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {, down}{, up}
Sleep, 100
Send {, down}{, up}
Sleep, 100
Send {/ down}{/ up}
Sleep, 100
Send {/ down}{/ up}
Sleep, 1000
Click, 1453 816
Sleep, 1000
Send {z down}{z up}
MouseMove, 2281, 971, 20
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {. down}{. up}
Sleep 100
Send {. down}{. up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Click, 1453 816
Sleep, 1000
Send {f down}{f up}
MouseMove, 2397, 967, 20,
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {. down}{. up}
Sleep 100
Send {. down}{. up}
Sleep 100
Click, 1453 816
Sleep, 1000
Send {Space down}{Space up}
Sleep, 1000
While true {
ImageSearch, foundx, foundy, 0, 0, A_ScreenWidth, A_ScreenHeight, next.png
if (foundx or foundy) {
Break
} else {
Sleep, 2000
}
}
Click, %foundx% %foundy%
foundx := 0
foundy := 0
Sleep, 1000
Click, 1002 1419
Sleep, 5000
}
Return
Escape::
ExitApp
Return

OK so I used your code with SetTimer instead of trying to use a continuous loop. It should create the same effect as a continuous loop.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Pixel
^b::
SetTimer, PlayGame, -10
Return
PlayGame:
Click, 1223 1553
Sleep, 1000
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 2581 693
Sleep, 100
Click, 801 1097
Sleep, 1000
Click, 882 668
Sleep, 1000
Click, 1994 720
Sleep, 5000
Click, 1444 1265,
Sleep, 1000
Send {k down}{k up}
MouseMove, 2381, 1100, 20
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {, down}{, up}
Sleep, 100
Send {, down}{, up}
Sleep, 100
Send {/ down}{/ up}
Sleep, 100
Send {/ down}{/ up}
Sleep, 1000
Click, 1453 816
Sleep, 1000
Send {z down}{z up}
MouseMove, 2281, 971, 20
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {. down}{. up}
Sleep 100
Send {. down}{. up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Send {/ down}{/ up}
Sleep 100
Click, 1453 816
Sleep, 1000
Send {f down}{f up}
MouseMove, 2397, 967, 20,
Sleep, 100
Click
Sleep, 1000
Click
Sleep, 1000
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {, down}{, up}
Sleep 100
Send {. down}{. up}
Sleep 100
Send {. down}{. up}
Sleep 100
Click, 1453 816
Sleep, 1000
Send {Space down}{Space up}
Sleep, 1000
Loop {
ImageSearch, foundx, foundy, 0, 0, A_ScreenWidth, A_ScreenHeight, next.png
if (ErrorLevel==0) {
Break
} ; else not needed because of Break above
Sleep, 2000
}
Click, %foundx% %foundy%
foundy := foundx := 0
Sleep, 1000
Click, 1002 1419
Sleep, 5000
setTimer, %A_ThisLabel%, -10
Return
Escape::
ExitApp
Return
Although I never script games myself, there are better ways to do this, but I'll let you figure that out as you learn more of the language.

Related

Can't install current version of the chrome driver by webdriver.Chrome(ChoromeDriverManager().install())

I want to install chromedriver.exe via piece of code
driver = webdriver.Chrome(ChromeDriverManager().install()), but instead of it I have obtained an error:
----------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:45, in Driver.get_version(self)
44 try:
---> 45 return self.get_latest_release_version()
46 except Exception:
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\drivers\chrome.py:53, in ChromeDriver.get_latest_release_version(self)
52 def get_latest_release_version(self):
---> 53 browser_version = self.get_browser_version()
54 log(f"Get LATEST {self._name} version for {self.get_browser_type()} {browser_version}")
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:55, in Driver.get_browser_version(self)
54 def get_browser_version(self):
---> 55 return get_browser_version_from_os(self.get_browser_type())
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:141, in get_browser_version_from_os(browser_type)
131 """Return installed browser version."""
132 cmd_mapping = {
133 ChromeType.GOOGLE: {
134 OSType.LINUX: linux_browser_apps_to_cmd(
135 "google-chrome",
136 "google-chrome-stable",
137 "google-chrome-beta",
138 "google-chrome-dev",
139 ),
140 OSType.MAC: r"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version",
--> 141 OSType.WIN: windows_browser_apps_to_cmd(
142 r'(Get-Item -Path "$env:PROGRAMFILES\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
143 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
144 r'(Get-Item -Path "$env:LOCALAPPDATA\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
145 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Google\Chrome\BLBeacon").version',
146 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome").version',
147 ),
148 },
149 ChromeType.CHROMIUM: {
150 OSType.LINUX: linux_browser_apps_to_cmd("chromium", "chromium-browser"),
151 OSType.MAC: r"/Applications/Chromium.app/Contents/MacOS/Chromium --version",
152 OSType.WIN: windows_browser_apps_to_cmd(
153 r'(Get-Item -Path "$env:PROGRAMFILES\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
154 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
155 r'(Get-Item -Path "$env:LOCALAPPDATA\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
156 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Chromium\BLBeacon").version',
157 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Chromium").version',
158 ),
159 },
160 ChromeType.BRAVE: {
161 OSType.LINUX: linux_browser_apps_to_cmd(
162 "brave-browser", "brave-browser-beta", "brave-browser-nightly"
163 ),
164 OSType.MAC: r"/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --version",
165 OSType.WIN: windows_browser_apps_to_cmd(
166 r'(Get-Item -Path "$env:PROGRAMFILES\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
167 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
168 r'(Get-Item -Path "$env:LOCALAPPDATA\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
169 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\BraveSoftware\Brave-Browser\BLBeacon").version',
170 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\BraveSoftware Brave-Browser").version',
171 ),
172 },
173 ChromeType.MSEDGE: {
174 OSType.LINUX: linux_browser_apps_to_cmd(
175 "microsoft-edge",
176 "microsoft-edge-stable",
177 "microsoft-edge-beta",
178 "microsoft-edge-dev",
179 ),
180 OSType.MAC: r"/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version",
181 OSType.WIN: windows_browser_apps_to_cmd(
182 # stable edge
183 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge\Application\msedge.exe").VersionInfo.FileVersion',
184 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge\Application\msedge.exe").VersionInfo.FileVersion',
185 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge\BLBeacon").version',
186 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Microsoft\EdgeUpdate\Clients\{56EB18F8-8008-4CBD-B6D2-8C97FE7E9062}").pv',
187 # beta edge
188 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
189 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
190 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
191 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge Beta\BLBeacon").version',
192 # dev edge
193 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
194 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
195 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
196 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge Dev\BLBeacon").version',
197 # canary edge
198 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge SxS\Application\msedge.exe").VersionInfo.FileVersion',
199 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge SxS\BLBeacon").version',
200 # highest edge
201 r"(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe').'(Default)').VersionInfo.ProductVersion",
202 r"[System.Diagnostics.FileVersionInfo]::GetVersionInfo((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe').'(Default)').ProductVersion",
203 r"Get-AppxPackage -Name *MicrosoftEdge.* | Foreach Version",
204 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge").version',
205 ),
206 },
207 "firefox": {
208 OSType.LINUX: linux_browser_apps_to_cmd("firefox"),
209 OSType.MAC: r"/Applications/Firefox.app/Contents/MacOS/firefox --version",
210 OSType.WIN: windows_browser_apps_to_cmd(
211 r'(Get-Item -Path "$env:PROGRAMFILES\Mozilla Firefox\firefox.exe").VersionInfo.FileVersion',
212 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Mozilla Firefox\firefox.exe").VersionInfo.FileVersion',
213 r"(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo.ProductVersion",
214 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Mozilla\Mozilla Firefox").CurrentVersion',
215 ),
216 },
217 }
219 try:
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:120, in windows_browser_apps_to_cmd(*apps)
119 """Create analogue of browser --version command for windows."""
--> 120 powershell = determine_powershell()
122 first_hit_template = """$tmp = {expression}; if ($tmp) {{echo $tmp; Exit;}};"""
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:272, in determine_powershell()
271 cmd = "(dir 2>&1 *`|echo CMD);&<# rem #>echo powershell"
--> 272 with subprocess.Popen(
273 cmd,
274 stdout=subprocess.PIPE,
275 stderr=subprocess.DEVNULL,
276 stdin=subprocess.DEVNULL,
277 shell=True,
278 ) as stream:
279 stdout = stream.communicate()[0].decode()
File C:\Program Files\Python310\lib\subprocess.py:969, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize)
966 self.stderr = io.TextIOWrapper(self.stderr,
967 encoding=encoding, errors=errors)
--> 969 self._execute_child(args, executable, preexec_fn, close_fds,
970 pass_fds, cwd, env,
971 startupinfo, creationflags, shell,
972 p2cread, p2cwrite,
973 c2pread, c2pwrite,
974 errread, errwrite,
975 restore_signals,
976 gid, gids, uid, umask,
977 start_new_session)
978 except:
979 # Cleanup if the child failed starting.
File C:\Program Files\Python310\lib\subprocess.py:1438, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session)
1437 try:
-> 1438 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1439 # no special security
1440 None, None,
1441 int(not close_fds),
1442 creationflags,
1443 env,
1444 cwd,
1445 startupinfo)
1446 finally:
1447 # Child is launched. Close the parent's copy of those pipe
1448 # handles that only the child should have open. You need
(...)
1451 # pipe will not close when the child process exits and the
1452 # ReadFile will hang.
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
Cell In[28], line 1
----> 1 driver = webdriver.Chrome(ChromeDriverManager().install())
2 #[WinError 2] The system cannot find the file specified
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\chrome.py:39, in ChromeDriverManager.install(self)
38 def install(self) -> str:
---> 39 driver_path = self._get_driver_path(self.driver)
40 os.chmod(driver_path, 0o755)
41 return driver_path
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\manager.py:26, in DriverManager._get_driver_path(self, driver)
25 def _get_driver_path(self, driver):
---> 26 binary_path = self.driver_cache.find_driver(driver)
27 if binary_path:
28 return binary_path
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver_cache.py:96, in DriverCache.find_driver(self, driver)
94 os_type = driver.get_os_type()
95 driver_name = driver.get_name()
---> 96 driver_version = driver.get_version()
97 browser_version = driver.get_browser_version()
98 browser_type = driver.get_browser_type()
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:47, in Driver.get_version(self)
45 return self.get_latest_release_version()
46 except Exception:
---> 47 return self.get_browser_version()
48 return self._version
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:55, in Driver.get_browser_version(self)
54 def get_browser_version(self):
---> 55 return get_browser_version_from_os(self.get_browser_type())
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:141, in get_browser_version_from_os(browser_type)
130 def get_browser_version_from_os(browser_type=None):
131 """Return installed browser version."""
132 cmd_mapping = {
133 ChromeType.GOOGLE: {
134 OSType.LINUX: linux_browser_apps_to_cmd(
135 "google-chrome",
136 "google-chrome-stable",
137 "google-chrome-beta",
138 "google-chrome-dev",
139 ),
140 OSType.MAC: r"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version",
--> 141 OSType.WIN: windows_browser_apps_to_cmd(
142 r'(Get-Item -Path "$env:PROGRAMFILES\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
143 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
144 r'(Get-Item -Path "$env:LOCALAPPDATA\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
145 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Google\Chrome\BLBeacon").version',
146 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome").version',
147 ),
148 },
149 ChromeType.CHROMIUM: {
150 OSType.LINUX: linux_browser_apps_to_cmd("chromium", "chromium-browser"),
151 OSType.MAC: r"/Applications/Chromium.app/Contents/MacOS/Chromium --version",
152 OSType.WIN: windows_browser_apps_to_cmd(
153 r'(Get-Item -Path "$env:PROGRAMFILES\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
154 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
155 r'(Get-Item -Path "$env:LOCALAPPDATA\Chromium\Application\chrome.exe").VersionInfo.FileVersion',
156 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Chromium\BLBeacon").version',
157 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Chromium").version',
158 ),
159 },
160 ChromeType.BRAVE: {
161 OSType.LINUX: linux_browser_apps_to_cmd(
162 "brave-browser", "brave-browser-beta", "brave-browser-nightly"
163 ),
164 OSType.MAC: r"/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --version",
165 OSType.WIN: windows_browser_apps_to_cmd(
166 r'(Get-Item -Path "$env:PROGRAMFILES\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
167 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
168 r'(Get-Item -Path "$env:LOCALAPPDATA\BraveSoftware\Brave-Browser\Application\brave.exe").VersionInfo.FileVersion',
169 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\BraveSoftware\Brave-Browser\BLBeacon").version',
170 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\BraveSoftware Brave-Browser").version',
171 ),
172 },
173 ChromeType.MSEDGE: {
174 OSType.LINUX: linux_browser_apps_to_cmd(
175 "microsoft-edge",
176 "microsoft-edge-stable",
177 "microsoft-edge-beta",
178 "microsoft-edge-dev",
179 ),
180 OSType.MAC: r"/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version",
181 OSType.WIN: windows_browser_apps_to_cmd(
182 # stable edge
183 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge\Application\msedge.exe").VersionInfo.FileVersion',
184 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge\Application\msedge.exe").VersionInfo.FileVersion',
185 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge\BLBeacon").version',
186 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Microsoft\EdgeUpdate\Clients\{56EB18F8-8008-4CBD-B6D2-8C97FE7E9062}").pv',
187 # beta edge
188 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
189 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
190 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge Beta\Application\msedge.exe").VersionInfo.FileVersion',
191 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge Beta\BLBeacon").version',
192 # dev edge
193 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
194 r'(Get-Item -Path "$env:PROGRAMFILES\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
195 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion',
196 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge Dev\BLBeacon").version',
197 # canary edge
198 r'(Get-Item -Path "$env:LOCALAPPDATA\Microsoft\Edge SxS\Application\msedge.exe").VersionInfo.FileVersion',
199 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Microsoft\Edge SxS\BLBeacon").version',
200 # highest edge
201 r"(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe').'(Default)').VersionInfo.ProductVersion",
202 r"[System.Diagnostics.FileVersionInfo]::GetVersionInfo((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe').'(Default)').ProductVersion",
203 r"Get-AppxPackage -Name *MicrosoftEdge.* | Foreach Version",
204 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge").version',
205 ),
206 },
207 "firefox": {
208 OSType.LINUX: linux_browser_apps_to_cmd("firefox"),
209 OSType.MAC: r"/Applications/Firefox.app/Contents/MacOS/firefox --version",
210 OSType.WIN: windows_browser_apps_to_cmd(
211 r'(Get-Item -Path "$env:PROGRAMFILES\Mozilla Firefox\firefox.exe").VersionInfo.FileVersion',
212 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Mozilla Firefox\firefox.exe").VersionInfo.FileVersion',
213 r"(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo.ProductVersion",
214 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Mozilla\Mozilla Firefox").CurrentVersion',
215 ),
216 },
217 }
219 try:
220 cmd_mapping = cmd_mapping[browser_type][os_name()]
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:120, in windows_browser_apps_to_cmd(*apps)
118 def windows_browser_apps_to_cmd(*apps: str) -> str:
119 """Create analogue of browser --version command for windows."""
--> 120 powershell = determine_powershell()
122 first_hit_template = """$tmp = {expression}; if ($tmp) {{echo $tmp; Exit;}};"""
123 script = "$ErrorActionPreference='silentlycontinue'; " + " ".join(
124 first_hit_template.format(expression=e) for e in apps
125 )
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\utils.py:272, in determine_powershell()
270 """Returns "True" if runs in Powershell and "False" if another console."""
271 cmd = "(dir 2>&1 *`|echo CMD);&<# rem #>echo powershell"
--> 272 with subprocess.Popen(
273 cmd,
274 stdout=subprocess.PIPE,
275 stderr=subprocess.DEVNULL,
276 stdin=subprocess.DEVNULL,
277 shell=True,
278 ) as stream:
279 stdout = stream.communicate()[0].decode()
280 return "" if stdout == "powershell" else "powershell"
File C:\Program Files\Python310\lib\subprocess.py:969, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize)
965 if self.text_mode:
966 self.stderr = io.TextIOWrapper(self.stderr,
967 encoding=encoding, errors=errors)
--> 969 self._execute_child(args, executable, preexec_fn, close_fds,
970 pass_fds, cwd, env,
971 startupinfo, creationflags, shell,
972 p2cread, p2cwrite,
973 c2pread, c2pwrite,
974 errread, errwrite,
975 restore_signals,
976 gid, gids, uid, umask,
977 start_new_session)
978 except:
979 # Cleanup if the child failed starting.
980 for f in filter(None, (self.stdin, self.stdout, self.stderr)):
File C:\Program Files\Python310\lib\subprocess.py:1438, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session)
1436 # Start the process
1437 try:
-> 1438 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1439 # no special security
1440 None, None,
1441 int(not close_fds),
1442 creationflags,
1443 env,
1444 cwd,
1445 startupinfo)
1446 finally:
1447 # Child is launched. Close the parent's copy of those pipe
1448 # handles that only the child should have open. You need
(...)
1451 # pipe will not close when the child process exits and the
1452 # ReadFile will hang.
1453 self._close_pipe_fds(p2cread, p2cwrite,
1454 c2pread, c2pwrite,
1455 errread, errwrite)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Therefore, I have to download into my system ditectory chromedriver.exe of 109.0.5414.74 version and activating one by code
PATH = 'C:/Program Files/chromedriver/chromedriver.exe'
options = Options()
service = Service(PATH)
driver = webdriver.Chrome(service = service, options = options).
Please, help me to fix eror in automatic installing ChromeDriver via code noted above.
My Chrome version is 109.0.5414.75.
This error message...
FileNotFoundError Traceback (most recent call last)
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:45, in Driver.get_version(self)
44 try:
---> 45 return self.get_latest_release_version()
46 except Exception:
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\drivers\chrome.py:53, in ChromeDriver.get_latest_release_version(self)
52 def get_latest_release_version(self):
---> 53 browser_version = self.get_browser_version()
54 log(f"Get LATEST {self._name} version for {self.get_browser_type()} {browser_version}")
File C:\Program Files\Python310\lib\site-packages\webdriver_manager\core\driver.py:55, in Driver.get_browser_version(self)
54 def get_browser_version(self):
---> 55 return get_browser_version_from_os(self.get_browser_type())
...implies that webdriver_manager was not able to detect the google-chrome version as FileNotFoundError was raised while the following queries were performed:
--> 141 OSType.WIN: windows_browser_apps_to_cmd(
142 r'(Get-Item -Path "$env:PROGRAMFILES\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
143 r'(Get-Item -Path "$env:PROGRAMFILES (x86)\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
144 r'(Get-Item -Path "$env:LOCALAPPDATA\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion',
145 r'(Get-ItemProperty -Path Registry::"HKCU\SOFTWARE\Google\Chrome\BLBeacon").version',
146 r'(Get-ItemProperty -Path Registry::"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome").version',
147 ),
Solution
Ensure that Google Chrome is updated to the latest version and is installed at the default location i.e. in either of the following locations:
PROGRAMFILES\Google\Chrome\Application\chrome.exe
PROGRAMFILES (x86)\Google\Chrome\Application\chrome.exe
LOCALAPPDATA\Google\Chrome\Application\chrome.exe

Google Sheets API - Timeout

I regularly use gspread and lately I've been getting these read timeout errors but only on certain sheets. Sometimes I'll be able to read & write to a sheet for a bit and then it'll hang until I get this read timeout error and then all subsequent attempts to read from that sheet will hang immediately and again give me this error.
---------------------------------------------------------------------------
timeout Traceback (most recent call last)
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
444 # Otherwise it looks like a bug in the code.
--> 445 six.raise_from(e, None)
446 except (SocketTimeout, BaseSSLError, SocketError) as e:
~/envs/jupyter/lib/python3.6/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
439 try:
--> 440 httplib_response = conn.getresponse()
441 except BaseException as e:
/usr/lib/python3.6/http/client.py in getresponse(self)
1372 try:
-> 1373 response.begin()
1374 except ConnectionError:
/usr/lib/python3.6/http/client.py in begin(self)
310 while True:
--> 311 version, status, reason = self._read_status()
312 if status != CONTINUE:
/usr/lib/python3.6/http/client.py in _read_status(self)
271 def _read_status(self):
--> 272 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
273 if len(line) > _MAXLINE:
/usr/lib/python3.6/socket.py in readinto(self, b)
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
/usr/lib/python3.6/ssl.py in recv_into(self, buffer, nbytes, flags)
1011 self.__class__)
-> 1012 return self.read(nbytes, buffer)
1013 else:
/usr/lib/python3.6/ssl.py in read(self, len, buffer)
873 try:
--> 874 return self._sslobj.read(len, buffer)
875 except SSLError as x:
/usr/lib/python3.6/ssl.py in read(self, len, buffer)
630 if buffer is not None:
--> 631 v = self._sslobj.read(len, buffer)
632 else:
timeout: The read operation timed out
During handling of the above exception, another exception occurred:
ReadTimeoutError Traceback (most recent call last)
~/envs/jupyter/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
448 retries=self.max_retries,
--> 449 timeout=timeout
450 )
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
755 retries = retries.increment(
--> 756 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
757 )
~/envs/jupyter/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
531 if read is False or not self._is_method_retryable(method):
--> 532 raise six.reraise(type(error), error, _stacktrace)
533 elif read is not None:
~/envs/jupyter/lib/python3.6/site-packages/urllib3/packages/six.py in reraise(tp, value, tb)
734 raise value.with_traceback(tb)
--> 735 raise value
736 finally:
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
705 headers=headers,
--> 706 chunked=chunked,
707 )
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
446 except (SocketTimeout, BaseSSLError, SocketError) as e:
--> 447 self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
448 raise
~/envs/jupyter/lib/python3.6/site-packages/urllib3/connectionpool.py in _raise_timeout(self, err, url, timeout_value)
336 raise ReadTimeoutError(
--> 337 self, url, "Read timed out. (read timeout=%s)" % timeout_value
338 )
ReadTimeoutError: HTTPSConnectionPool(host='sheets.googleapis.com', port=443): Read timed out. (read timeout=120)
During handling of the above exception, another exception occurred:
ReadTimeout Traceback (most recent call last)
<ipython-input-70-dc10e6e8ee1a> in <module>
----> 1 max_sheet.range('A1:B1')
~/envs/jupyter/lib/python3.6/site-packages/gspread/utils.py in wrapper(self, *args, **kwargs)
396 pass
397
--> 398 return method(self, *args, **kwargs)
399
400 return wrapper
~/envs/jupyter/lib/python3.6/site-packages/gspread/models.py in range(self, name)
686 range_label = absolute_range_name(self.title, name)
687
--> 688 data = self.spreadsheet.values_get(range_label)
689
690 start, end = name.split(':')
~/envs/jupyter/lib/python3.6/site-packages/gspread/models.py in values_get(self, range, params)
190 """
191 url = SPREADSHEET_VALUES_URL % (self.id, quote(range))
--> 192 r = self.client.request('get', url, params=params)
193 return r.json()
194
~/envs/jupyter/lib/python3.6/site-packages/gspread/client.py in request(self, method, endpoint, params, data, json, files, headers)
68 data=data,
69 files=files,
---> 70 headers=headers,
71 )
72
~/envs/jupyter/lib/python3.6/site-packages/requests/sessions.py in get(self, url, **kwargs)
553
554 kwargs.setdefault('allow_redirects', True)
--> 555 return self.request('GET', url, **kwargs)
556
557 def options(self, url, **kwargs):
~/envs/jupyter/lib/python3.6/site-packages/google/auth/transport/requests.py in request(self, method, url, data, headers, max_allowed_time, timeout, **kwargs)
486 headers=request_headers,
487 timeout=timeout,
--> 488 **kwargs
489 )
490 remaining_time = guard.remaining_timeout
~/envs/jupyter/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
540 }
541 send_kwargs.update(settings)
--> 542 resp = self.send(prep, **send_kwargs)
543
544 return resp
~/envs/jupyter/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
653
654 # Send the request
--> 655 r = adapter.send(request, **kwargs)
656
657 # Total elapsed time of the request (approximately)
~/envs/jupyter/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
527 raise SSLError(e, request=request)
528 elif isinstance(e, ReadTimeoutError):
--> 529 raise ReadTimeout(e, request=request)
530 else:
531 raise
ReadTimeout: HTTPSConnectionPool(host='sheets.googleapis.com', port=443): Read timed out. (read timeout=120)
I tried taking gspread out of it for troubleshooting but it still gives me the same issue even when I'm using code from the python quickstart example from https://developers.google.com/sheets/api/quickstart/python (below). The timeout issue is the same whether I do it from my local machine or my jupyter server on digitalocean.
from googleapiclient.discovery import build
from google.oauth2.service_account import Credentials
creds = Credentials.from_service_account_file('XXXXXXX', scopes=SCOPES)
service = build('sheets', 'v4', credentials=creds)
sheet = service.spreadsheets()
result = sheet.values().get(spreadsheetId='XXXXXXX',
range='Active Accounts - working copy!A1:A2').execute()
values = result.get('values', [])
The above code results in this:
---------------------------------------------------------------------------
timeout Traceback (most recent call last)
<ipython-input-95-5c352599e283> in <module>
1 sheet = service.spreadsheets()
2 result = sheet.values().get(spreadsheetId='XXXXXX',
----> 3 range='Active Accounts - working copy!A1:A2').execute()
4 values = result.get('values', [])
~/envs/jupyter/lib/python3.6/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs)
132 elif positional_parameters_enforcement == POSITIONAL_WARNING:
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135
136 return positional_wrapper
~/envs/jupyter/lib/python3.6/site-packages/googleapiclient/http.py in execute(self, http, num_retries)
899 method=str(self.method),
900 body=self.body,
--> 901 headers=self.headers,
902 )
903
~/envs/jupyter/lib/python3.6/site-packages/googleapiclient/http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
202 if exception:
203 if retry_num == num_retries:
--> 204 raise exception
205 else:
206 continue
~/envs/jupyter/lib/python3.6/site-packages/googleapiclient/http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
175 try:
176 exception = None
--> 177 resp, content = http.request(uri, method, *args, **kwargs)
178 # Retry on SSL errors and socket timeout errors.
179 except _ssl_SSLError as ssl_error:
~/envs/jupyter/lib/python3.6/site-packages/google_auth_httplib2.py in request(self, uri, method, body, headers, **kwargs)
196 # Make the request.
197 response, content = self.http.request(
--> 198 uri, method, body=body, headers=request_headers, **kwargs)
199
200 # If the response indicated that the credentials needed to be
~/envs/jupyter/lib/python3.6/site-packages/httplib2/__init__.py in request(self, uri, method, body, headers, redirections, connection_type)
1989 headers,
1990 redirections,
-> 1991 cachekey,
1992 )
1993 except Exception as e:
~/envs/jupyter/lib/python3.6/site-packages/httplib2/__init__.py in _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey)
1649
1650 (response, content) = self._conn_request(
-> 1651 conn, request_uri, method, body, headers
1652 )
1653
~/envs/jupyter/lib/python3.6/site-packages/httplib2/__init__.py in _conn_request(self, conn, request_uri, method, body, headers)
1587 pass
1588 try:
-> 1589 response = conn.getresponse()
1590 except (http.client.BadStatusLine, http.client.ResponseNotReady):
1591 # If we get a BadStatusLine on the first try then that means
/usr/lib/python3.6/http/client.py in getresponse(self)
1371 try:
1372 try:
-> 1373 response.begin()
1374 except ConnectionError:
1375 self.close()
/usr/lib/python3.6/http/client.py in begin(self)
309 # read until we get a non-100 response
310 while True:
--> 311 version, status, reason = self._read_status()
312 if status != CONTINUE:
313 break
/usr/lib/python3.6/http/client.py in _read_status(self)
270
271 def _read_status(self):
--> 272 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
273 if len(line) > _MAXLINE:
274 raise LineTooLong("status line")
/usr/lib/python3.6/socket.py in readinto(self, b)
584 while True:
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
588 self._timeout_occurred = True
/usr/lib/python3.6/ssl.py in recv_into(self, buffer, nbytes, flags)
1010 "non-zero flags not allowed in calls to recv_into() on %s" %
1011 self.__class__)
-> 1012 return self.read(nbytes, buffer)
1013 else:
1014 return socket.recv_into(self, buffer, nbytes, flags)
/usr/lib/python3.6/ssl.py in read(self, len, buffer)
872 raise ValueError("Read on closed or unwrapped SSL socket.")
873 try:
--> 874 return self._sslobj.read(len, buffer)
875 except SSLError as x:
876 if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
/usr/lib/python3.6/ssl.py in read(self, len, buffer)
629 """
630 if buffer is not None:
--> 631 v = self._sslobj.read(len, buffer)
632 else:
633 v = self._sslobj.read(len)
timeout: The read operation timed out

Run AutoIT script in silent mode

I have an AutoIT script that will automate all the system testing configurations in my company. It works fine without any user interaction however I am wondering if it will be possible to run in silent mode as the script contains quite a few mouseclicks.
Here is a code snippet:
Run("C:\AutoTestPackage\TestSuite\SmokeTest\WCF\Prerequisite\BISSDK\WcfClient.TestApp.exe")
_WinWaitCheck($WCFClient)
WinActivate($WCFClient)
WinMove($WCFClient, "", 64, 200, 1200, 600)
Sleep(1000)
MouseClick("", 400, 60, 1) ;Click on Username textbox
Sleep(250)
Send($OperatorName)
Sleep(500)
MouseClick("", 700, 60, 1) ;Click on Password textbox
Sleep(250)
Send($FinalOperatorPassword)
Sleep(1000)
MouseClick("", 1080, 50, 1) ;Click on Ping option
Sleep(1000)
MouseClick("", 70, 74, 1); Click on SynchronLogon
Sleep(1000)
Any help would be greatly appreciated :)

Android 10 adb shell input keyevent returns 0

I'm trying to use ADB shell input keyevent 1000 to test my custom hardware device in android 10, but it returns 0 in ADB log.
Secondly, I found ADB shell input keyevent 288 returns keycode 288, ADB shell input keyevent 289 returns 0. and the max keycode in original KeyEvent.java is 288.
How could I use ADB shell input keyevent 1000 return 1000 in android 10?
05-07 04:03:50.360 1271 1514 D InputDispatcher: Setting input event injection result to 0. injectorPid=6874, injectorUid=2000
05-07 04:03:50.361 1271 4338 D InputDispatcher: injectInputEvent - Waiting for 1 pending foreground dispatches.
05-07 04:03:50.365 3187 3187 D ViewRootImpl: processKeyEvent oldKeycode: 0 and newKeycode: 0
05-07 04:03:50.368 1271 4338 D InputDispatcher: injectInputEvent - Finished with result 0. injectorPid=6874, injectorUid=2000
when you input key > 288 will return 0, see InputReader.cpp:
if (getEventHub()->mapKey(getDeviceId(), scanCode, usageCode, mMetaState, &keyCode, &keyMetaState, &policyFlags)) {
keyCode = AKEYCODE_UNKNOWN;
keyMetaState = mMetaState;
policyFlags = 0;
}
if you could not get the mapkey, it will return AKEYCODE_UNKNOWN.

React Native Android - Build Successful - But Doesn't Open

My app builds successfully, opens on the emulator, then immediately shuts down. I spent almost 24 hours straight studying what could be wrong and going over all the answers and none of them work for me. Here is the final details...
BUILD SUCCESSFUL in 21s
262 actionable tasks: 1 executed, 261 up-to-date
info Running adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on emulator-5554 (adb -s emulator-5554 shell am start -n com.myapp/com.myapp.MainActivity)...
Starting: Intent { cmp=com.myapp/.MainActivity }
Would greatly appreciate someone figuring this out with me!
Here is the logcat...
10-17 13:27:27.409 3405 3492 I MicroDetector: Keeping mic open: false
10-17 13:27:27.409 3405 3492 I MicroDetectionWorker: #onError(false)
10-17 13:27:27.498 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-17 13:27:27.498 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-17 13:27:28.501 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-17 13:27:28.501 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-17 13:27:28.519 2021 2368 W AppOps : Noting op not finished: uid 10101 pkg com.google.android.gms code 41 time=1571344043502 duration=0
10-17 13:27:29.506 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-17 13:27:29.506 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-17 13:27:30.511 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-17 13:27:30.511 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-17 13:27:31.515 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-17 13:27:31.515 1756 2440 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-17 13:27:32.413 3405 3492 I MicroDetectionWorker: #startMicroDetector [speakerMode: 0]
10-17 13:27:32.414 3405 3492 W ErrorReporter: reportError [type: 211, code: 393244, bug: 0]: errorCode: 393244, engine: 0
try turning debugger off and on again
try building the code in xcode/android studio, inspect errors if any
usually it's a debugger issue for me. good luck!
Okay - I found the problem and have finally got this up and running. Way, way, way high up in the logcat was a message from Google Admob saying that I needed to add the appId in the meta tag of the AndroidManifest file. This was very hard to find because the logcat keeps running constantly and even if you look deep in the log it disappears quickly.
To figure this out I started adb logcat in a new shell (terminal window), gave it a second to fill up, then cleared it using CMD K, then in another shell ran react-native run-android.
When it fully built I immediately pressed Cmd C in the logcat window to stop it from running. Then I scrolled all the way to the top and found the error message from Google AdMob with instructions to add the following code to the AndroidManifest.xml file within the <application></application> section...
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
It also stated that without this the app would crash. So I added my id and now have a running app in the emulator.