[Solved] JNI Error: ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

1. Error description

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

What went wrong:
Execution failed for task ‘:app:externalNativeBuildDebug’.

Build command failed.
Error while executing process D:\ProgramFiles\Android\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments

2. Cause of error

When developing JNI, this error occurs during compilation. It may be that the path of NDK is not set

3. Solutions

Add the path to the NDK in local.properties in the project directory
eg:

ndk.dir=D\:\\ProgramFiles\\Android\\sdk\\ndk\\21.3.6528147

Read More: