Android Gradle Plugin regression with CMake 3.20.0
CMake 3.20.0 was recently released, and Azure DevOps Linux agents and GitHub Mac agents have upgraded to this version (from 3.19.6). In both of these cases, builds for multiple of our projects have started failing with the following notable build log snippets:
CMakeLists.txt : C/C++ release|armeabi-v7a : Start JSON generation. Platform version: 21 min SDK version: armeabi-v7a
CMakeLists.txt : C/C++ release|armeabi-v7a : Gradle local properties file not found at /Users/runner/work/BabylonReactNative/BabylonReactNative/Apps/Playground/android/local.properties
CMakeLists.txt : C/C++ release|armeabi-v7a : Trying to locate CMake in local SDK repository.
CMakeLists.txt : C/C++ release|armeabi-v7a : CMake '3.10.2' found in SDK could not satisfy requested version '3.13.2' because it was lower.
CMakeLists.txt : C/C++ release|armeabi-v7a : Requested CMake version 3.13.2 was not satisfied by default version 3.10.2 for this Android Gradle Plugin
CMakeLists.txt : C/C++ release|armeabi-v7a : Trying to locate CMake in PATH.
CMakeLists.txt : C/C++ release|armeabi-v7a : - CMake found in PATH at '/usr/local' had version '3.20.0'
...
CMakeLists.txt : C/C++ release|armeabi-v7a : rebuilding JSON /Users/runner/work/BabylonReactNative/BabylonReactNative/Modules/@babylonjs/react-native/android/.cxx/cmake/release/armeabi-v7a/android_gradle_build.json due to:
CMakeLists.txt : C/C++ release|armeabi-v7a : - expected json /Users/runner/work/BabylonReactNative/BabylonReactNative/Modules/@babylonjs/react-native/android/.cxx/cmake/release/armeabi-v7a/android_gradle_build.json file is not present, will remove stale json folder
CMakeLists.txt : C/C++ release|armeabi-v7a : - missing previous command file /Users/runner/work/BabylonReactNative/BabylonReactNative/Modules/@babylonjs/react-native/android/.cxx/cmake/release/armeabi-v7a/build_command.txt, will remove stale json folder
CMakeLists.txt : C/C++ release|armeabi-v7a : - command changed from previous, will remove stale json folder
CMakeLists.txt : C/C++ release|armeabi-v7a : removing stale contents from '/Users/runner/work/BabylonReactNative/BabylonReactNative/Modules/@babylonjs/react-native/android/.cxx/cmake/release/armeabi-v7a'
CMakeLists.txt : C/C++ release|armeabi-v7a : created folder '/Users/runner/work/BabylonReactNative/BabylonReactNative/Modules/@babylonjs/react-native/android/.cxx/cmake/release/armeabi-v7a'
CMakeLists.txt : C/C++ release|armeabi-v7a : executing cmake Executable : /usr/local/bin/cmake
...
CMakeLists.txt : C/C++ release|armeabi-v7a : null
...
> Task :babylonjs_react-native:generateJsonModelRelease FAILED
* What went wrong:
:babylonjs_react-native:generateJsonModelRelease (Thread[Daemon worker,5,main]) completed. Took 8.735 secs.
Execution failed for task ':babylonjs_react-native:generateJsonModelRelease'.
> java.lang.NullPointerException (no error message)
I was able to repro this locally as well by simply upgrading from CMake 3.16.5 (what I've been using for some time) to CMake 3.20.0. This repros in our open source project which can be found here: https://github.com/BabylonJS/BabylonReactNative/pull/193/checks?check_run_id=2256782153
Edited by Brad King