Magento 2.2.4 : Different group dependency not working

It's only working if your field ID is under parent group ID. For apply dependency in other group, You need to add like this :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="sectionID" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Name</label>
            <tab>TabName</tab>
            <resource>CompanyName_ModuleName::methodName</resource>
            <group id="groupID" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General Configuration</label>
                <field id="fieldID" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
            <group id="groupID2" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Form Configuration</label>
                <field id="fieldID2" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Check</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends>
                        <field id="sectionID/groupID/fieldID">1</field>
                    </depends>
                </field>
            </group>
        </section>
    </system>
</config>

Hope, It may be helpful for you. It should be working.


The issue can be solved simply by mentioning the full path if the field is not in the current group. e.g.

<depends>
    <field id="section/group/field">1</field>
</depends>

Good Luck!