Hi, I am trying to build the Golang Android native application using Gradle and CMake. And I would like to ask for help with the CMake configuration.
I uploaded the project I’m testing on to GitHub GitHub - tomas-mraz/studio-gradle-cmake-go: Building native Golang Android application from Android Studio
compile is like: Gradle → Gradle plugin com.android.build.api.dsl.NdkBuild → cmake with File API → go build
Result should be .so
shared library and .apk
application package with the library inside.
It looks like File API json file for custom build target “build-go-lib” is pointing to files that do not exist (was not generated).
It results in Gradle failure:
C/C++: /home/tomas/aplikace2/app/src/main/cpp/CMakeLists.txt debug|arm64-v8a : There was an error parsing CMake File API result. Please open a bug with zip of /home/tomas/aplikace2/app/.cxx/Debug/3v82m1s2/arm64-v8a
Please very much to check my CMakeFiles.txt for mistakes (me and AI have exhausted our options)
In the file /home/tomas/aplikace2/app/.cxx/Debug/4zb12x4p/arm64-v8a/.cmake/api/v1/reply/target-build-go-lib-Debug-ee877b4d829a5e2f94b2.json
is content…
"sources" :
[
{
"backtrace" : 1,
"isGenerated" : true,
"path" : "/home/tomas/aplikace2/app/.cxx/Debug/4zb12x4p/arm64-v8a/CMakeFiles/build-go-lib",
"sourceGroupIndex" : 0
},
But /home/tomas/aplikace2/app/.cxx/Debug/4zb12x4p/arm64-v8a/CMakeFiles/build-go-lib
does not exist … why?
CMake itself and Ninja works … it makes .so shared library. But Gradle build failed on CMake integration.