This problem occurred because I needed to repackage a long-ago Android project, and before that, my computer reinstalled the system, which caused the NDK directory to change.
Find the file in the project directory of Android Studio local.properties
, where you can see the path configuration of ndk, and change it to the latest one to solve the problem.