Although kinase-targeted drugs have achieved significant clinical success, they are frequently subject to the limitations of drug resistance, which has become a primary vulnerability to targeted drug therapy. Therefore, deciphering resistance mechanisms is an important step in designing more efficacious, anti-resistant, drugs. Here we studied two FDA-approved kinase drugs: Crizotinib and Ceritinib, which are first- and second-generation anaplastic lymphoma kinase (ALK) targeted inhibitors, to unravel drug-resistance mechanisms. We used an on-the-fly, function-site interaction fingerprint (on-the-fly Fs-IFP) approach by combining binding free energy surface calculations with the Fs-IFPs. Establishing the potentials of mean force and monitoring the atomic-scale protein-ligand interactions, before and after the L1196M-induced drug resistance, revealed insights into drug-resistance/anti-resistant mechanisms. Crizotinib prefers to bind the wild type ALK kinase domain, whereas Ceritinib binds more favorably to the mutated ALK kinase domain, in agreement with experimental results. We determined that ALK kinase-drug interactions in the region of the front pocket are associated with drug resistance. Additionally, we find that the L1196M mutation does not simply alter the binding modes of inhibitors, but also affects the flexibility of the entire ALK kinase domain. Our work provides an understanding of the mechanisms of ALK drug resistance, confirms the usefulness of the on-the-fly Fs-IFP approach and provides a practical paradigm to study drug-resistance mechanisms in prospective drug discovery.