I have download ndk and start to make demo for "Hello World"
Make project with ref Android studio NDK
Download Cmake and put in sdk folder.
No change in code during gradle sync there is error like:
External Native Build Issues
Error while executing 'D:\android\Sdk\cmake\bin\cmake.exe' with arguments {-HD:\Data\Demo\TestNDK\app -BD:\Data\Demo\TestNDK\app\.externalNativeBuild\cmake\release\armeabi -GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=D:\android\Sdk\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Data\Demo\TestNDK\app\.externalNativeBuild\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=D:\android\Sdk\cmake\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=D:\android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=22 -DCMAKE_CXX_FLAGS=-frtti -fexceptions}
CMake Error: Could not create named generator Android Gradle - Ninja
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Getting above error in default NDK Setting
Download Cmake and put in sdk folder.
You need to get cmake via the SDK manager to use it with Android Studio.
Related
I am working on an Android native project which builds using CMake.
In my build.gradle I specify :
if(project.hasProperty("native")) {
externalNativeBuild {
cmake {
path file('jni/CMakeLists.txt')
version '3.18.1+'
}
}
}
I want to invoke externalNativeBuild task from command-line only on an automated build server.
However I am getting this error:
CMake '3.18.1' or higher was not found in SDK, PATH, or by cmake.dir property.
When I build it inside Android Studio normally, It downloads and install CMake but it is not happening from command-line.
Is there a way to do it from command-line?
Android studio will automatically create a local.properties file which contains the cmake.dir property.
When you build on the build server, it's more than likely that you your source doesn't have a local.properties file as that file is not normally checked into code repositories. You'll either need to create this file or modify the PATH environment variable to include the cmake binary. This of course presumes that you have CMake installed on the build server. You can do this manually with a .zip/.tarball or if you have access to the SDK on the build server, you can install with the build tools -> How to install Android SDK Build Tools on the command line?
How to setup CMake 3.18.1 in an Android project with gradle on Android Studio?
I executed the following steps:
downloaded the CMake 3.18.1 from Android Sdk - Sdk Tools (folder appeared correctly on Android/sdk/cmake with the 3.10 and 3.6 version)
I added the version requested on build.gradle as externalNativeBuild { cmake { version "3.18.1"
I added the path on local.properties as cmake.dir=/Users/bloom/Library/Android/sdk/cmake/3.18.1
I get the error message: C/C++ release|armeabi-v7a : CMake '3.18.1' found via cmake.dir='/Users/bloom/Library/Android/sdk/cmake/3.18.1' does not match requested version '3.10.2'. and the task failed is > Task :app:generateJsonModelDebug FAILED
I suspect there is a 3.10 version hardcoded somewhere, maybe on that task. In fact, undoing point 3 and requesting version 3.6 is ignored. With 3.10 I get an error on findBoost and it clearly shows that is using the 3.10 version, as you can see Make Warning at /Users/bloom/Library/Android/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
Error information: NDK solution Result: Project settings: Gradle model version = 6.1, NDK version UNKNOWN
However, the NDK has been defined in the Project Structure > SDK location > Android NDK location: android \ sdk \ ndk \ 21.0.6113669.
What is the cause of the error?
If the synchronization is normal, the compilation is successful. However, if the synchronization is performed only, the APK file is not packed and generated. In this case, try Build->Build Bundle(s)/APK(s)->Build APK(s). The generated APK file is stored in the project directory\build\outputs\apk\debug directory.
The error message "NDK Resolution Outcome: Project settings: Gradle model version=6.1, NDK version is UNKNOWN" should be displayed in the Event Log, which does not affect the compilation of the project.
If the project fails to be compiled, provide the build error information.
If an error occurs, click Run build in the Build window to display the detailed error information.
i was downloaded the official telegram source from this link :
https://github.com/DrKLO/Telegram
when i try to run this app , the gradle sync fail & gives me the following error :
Error:Gradle: A problem occurred configuring project ':TMessagesProj'.
executing external native build for ndkBuild C:\Users\Moonwalker\Desktop\Telegram-master\TMessagesProj\jni\Android.mk
alson downloaded the ndk bundle ...no success
my sdk version : 23
andriod studio 2.3.1
win 10 .
anyone can help ?
You must add recursive to git clone. Something like this:
git clone --recursive git#github.com:DrKLO/Telegram.git
Or this:
git clone --recursive http://github.com/DrKLO/Telegram.git
I cannot build the project using Idea, I get following message right after launch:-
Error:Android Gradle Build Target: org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\username\.gradle\wrapper\dists\gradle-1.11-bin\4h5v8877arc3jhuqbm3osbr7o7\gradle-1.11'.
content of following directory:
c:\Users\malousek\.gradle\wrapper\dists\gradle-1.11-bin\4h5v8877arc3jhuqbm3osbr7o7\gradle-1.11\
is following:
bin
init.d
lib
media
changelog, license, notice,
IDEA Settings for Gradle:
Use Default Gradle Wrapper (recommended)
Last time I tried Intellij 13 It had many problems with Gradle (1.11+), use Intellij EAP 14 or switch to Android Studio.
You can try removing "C:\Users\username.gradle\wrapper\dists\" directory and resync your gradle project.