When Gradle don't know your new added Native code
This post talking about using Android studio with ver. 3.1.4 or above that will help you integrate your Native code more easily than the older version. Using default CMake.txt will help you alot during complie your native code.
There are sometimes, in the middle of developing. You have to integrate a Native code to you apps. This time Gradle comes to no idea about your files. You may have been warned "This file is not part of the project. Please include it in the appropriate build file" indicated that gradle did not known your CMakeLists.txt as the image below.
What you have to do is to make the Gradle know you CMakeLists.txt
Navigate your project to Gradle from lefe panel -> project -> apps -> build.gradle
And edit the build.gradle so as the image below.
If you library (such as JNI header, Native .C or .C++ code) and CMakeLists.txt were configured correctly. You shouldn't get any error when you start to compile them.
Well, as usual, thank you for reading until the end. I'm not
only fond of writing but also love to read. If you have something similar or a
better solution, Please share it to me by writing down on the comment or send
us an Email directly. Many Thanks!
Comments
Post a Comment