Challenges Locating Elements in In-App Dialogue Boxes After Migrating to Appium 2 with 'AppiumBy

After migrating from Appium 1 to Appium 2, I replaced all instances of the “By” keyword with “AppiumBy.” While most of the locators are working fine, I am unable to locate elements within in-app dialogue boxes using “AppiumBy.” It’s worth noting that this functionality works as expected when I use the “By” keyword.