I have been trying to access some CPP Libraries from android and have been following the instructions here:
https://developer.android.com/studio/projects/add-native-code.html#link-gradle
The issue is that there doesn't seem to be an option to 'Link C++ Project with Gradle' when I right click on the app module. Has anyone else had this issue? Did you solve it?
Check in your build.gradle file for your App's module. Mine looked like this from the default Android Project:
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
I removed the cmake section and resynced the project and then the "Link C++ Project with Gradle" was finally available as an option.
Look for a file called "build.gradle"( Module: app ) in "Gradle Scripts" folder.
defaultConfig {
...
}
buildTypes {
...
}
Add:
externalNativeBuild {
}
Save and Sync Now
Then right click on "app" and you will see "Link C++ Project with Gradle"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With