由于Cmake检查,Android NDK项目需要数年才能完成gradle buid

时间:2017-12-23 20:35:14

标签: android c++ gradle cmake android-ndk

出于某种原因,我的Android NDK项目需要数年才能完成刷新或构建。问题仅在第一次创建项目或修改CMakeLists.txt时发生。

完美可能需要45分钟,但在此之后,下一次构建速度很快(1分钟或更短)。在此期间,IDE无法使用,因为它没有正确的项目结构和配置。

我正在使用Gradle 4.1,Android插件3.0.1和NDK 16.1(此时的最后一个)。

这是日志显示的内容(完整日志here

Executing tasks: [assemble]

Configuration on demand is an incubating feature.
CMake Warning at <android_path>/Android/ndk-bundle/build/cmake/android.toolchain.cmake:63 (message):
  Using custom NDK path (ANDROID_NDK is set):
  C:\Users\Fran\AppData\Local\Android\ndk-bundle
Call Stack (most recent call first):
  <android_path>/Android/cmake/3.6.4111459/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt
-- Check for working C compiler: <android_path>/Android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: <android_path>/Android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: <android_path>/Android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe
-- Check for working CXX compiler: <android_path>/Android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: <project_path>/NativeTest/app/.externalNativeBuild/cmake/debug/armeabi-v7a

有没有办法每次都避免所有这些检查?或者任何方式来加快这个过程?

1 个答案:

答案 0 :(得分:0)

如上面的评论所述,问题解决了,没有做任何与问题相关的事情,比如更改配置或更新IDE或SDK ......很奇怪......

我唯一要做的就是更新系统(Windows)......也许我有一些破坏了更新修复的内容......?