NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN

NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN
0

Hi i have problem with android studio project, until yesterday was worked. But i think when i execute gradle update make this issue. From this moment i cant build the app because i have the followin message:

Gradle sync failed: executing external native build for cmake /Users/…/CMakeLists.txt (4 s 813 ms)

22:06 NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN

And in stacktrace show:

org.gradle.api.GradleException: executing external native build for cmake /Users/mexicanobermudez/Documents/workspace_divino/mobile/app/CMakeLists.txt
at com.android.build.gradle.internal.cxx.logging.ErrorsAreFatalThreadLoggingEnvironment.close(ErrorsAreFatalThreadLoggingEnvironment.kt:50)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.buildForOneConfigurationConvertExceptions(ExternalNativeJsonGenerator.java:164)
at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.buildForOneAbiName(ExternalNativeJsonGenerator.java:208)
at com.android.build.gradle.internal.ide.NativeModelBuilder.buildNativeVariantAbi(NativeModelBuilder.kt:149)
at com.android.build.gradle.internal.ide.NativeModelBuilder.buildAll(NativeModelBuilder.kt:97)
at com.android.build.gradle.internal.ide.NativeModelBuilder.buildAll(NativeModelBuilder.kt:38)
at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$ParameterizedBuildOperationWrappingToolingModelBuilder$1$1.create(DefaultToolingModelBuilderRegistry.java:138)
at org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:132)
at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$ParameterizedBuildOperationWrappingToolingModelBuilder$1.call(DefaultToolingModelBuilderRegistry.java:134)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOpera

I try download new NDK, Import again the project, Undate gradle version, and others worksarounds, but any was working.

I appresiate any colaboration.

THANKS

Try adding ndkVersion to your gradle.build file if it’s missing. For example:

android {
    compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
    ndkVersion "20.0.5594570"

    defaultConfig {

Thanks for you response but the error persist

Have you checked your project settings?

If all else fails, try uninstalling Android Studio and installing the latest version. The automatic update has some strange bugs that a few here have encountered before.

This is in the last version of android studio

Can you share you configuration project the is the tab above SDK Location

image

I generate a new project and copy the classes and resources, i dont solve this problem but it is the workaround i found

The solution(Workaround) was founded is:

Generate a new project with the same package and name in other path, copy all classes and resources, compile to verify all build succesfull. If you have a git repository linked to the old path, copy cocos2d and project.android folder from the new to the old path(for some reason is not enough copy only project.android), then compile again old path and all is working again. I try many alternative solutions but nothing work for me.

Thank @R101 for your help.

I’m glad you got it sorted. That issue happens a lot with the Android build, mainly because some files are changed by Android Studio, and eventually it breaks the build. The only way to get it working again is to get a clean version of those files. I just make sure that a working proj.android is always in my source control, so if it breaks, I compare the differences and revert back to the working version if required.

Also, whenever you have problems, delete these folders inside proj.android:
image

and these in proj.android/app/:
image

before trying anything else.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.