前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【错误记录】NDK 配置错误 ( C/C++ debug|arm64-v8a : Could not get version from cmake.dir path )

【错误记录】NDK 配置错误 ( C/C++ debug|arm64-v8a : Could not get version from cmake.dir path )

作者头像
韩曙亮
发布2023-03-29 14:29:16
1.1K0
发布2023-03-29 14:29:16
举报
文章被收录于专栏:韩曙亮的移动开发专栏

文章目录

一、报错信息


重装系统后 , 打开一年前的项目 , 报如下错误 :

代码语言:javascript
复制
CMakeLists.txt : C/C++ debug|arm64-v8a : Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.

完整报错信息 :

代码语言:javascript
复制
Executing tasks: [:app:assembleDebug] in project D:\002_Project\Application


> Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :sample9_4:preBuild UP-TO-DATE
> Task :sample9_4:preDebugBuild UP-TO-DATE
> Task :sample9_4:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :sample9_4:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :sample9_4:compileDebugRenderscript NO-SOURCE
> Task :sample9_4:generateDebugResValues
> Task :sample9_4:generateDebugResources
> Task :sample9_4:packageDebugResources
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :sample9_4:extractDeepLinksDebug
> Task :sample9_4:writeDebugAarMetadata
> Task :sample9_4:generateDebugBuildConfig

> Task :app:generateJsonModelDebug FAILED
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.
Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.

> Task :sample9_4:javaPreCompileDebug
> Task :app:javaPreCompileDebug
> Task :sample9_4:processDebugManifest
> Task :sample9_4:parseDebugLocalResources
> Task :app:checkDebugAarMetadata
> Task :sample9_4:compileDebugLibraryResources
> Task :app:mergeDebugResources

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
> D:\002_Project\Application\app\src\main\cpp\CMakeLists.txt : C/C++ debug|arm64-v8a : Could not get version from cmake.dir path 'D:\001_Programs\001_Android\002_Sdk\Sdk\cmake\3.10.2.4988404'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
17 actionable tasks: 17 executed

二、解决方案


出现这种问题是因为 NDK 目录配置错误 , 要么之前的配置没有删除干净 , 要么电脑上的 SDK 中没有安装 NDK ;

1、方案一

打开 local.properties 文件 , 发现有如下配置 , 直接删除 cmake.dir 配置 ;

代码语言:javascript
复制
sdk.dir=D\:\\001_Develop\\001_SDK\\Sdk
cmake.dir=D\:\\001_Programs\\001_Android\\002_Sdk\\Sdk\\cmake\\3.10.2.4988404

2、方案二

点击 " Download " 按钮 , 下载最新 NDK ;

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-07-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 一、报错信息
  • 二、解决方案
    • 1、方案一
      • 2、方案二
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档