Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: how to undo "Link C++ project with gradle"

I right clicked my NDK project and chose "Link C++ project with gradle". I added Android.mk file there. "cpp" folder appeared. So far is fine.

Now I want undo this and assign the Android.mk path again, as I chose the wrong path earlier. How can I do this?

like image 913
M. Usman Khan Avatar asked Mar 09 '23 19:03

M. Usman Khan


2 Answers

If you look at the build.gradle file of your module you will find an entry for linking to your native code in the following format :

externalNativeBuild {
        ndkBuild {
            path '../../../src/Android.mk'
        }
    }

either change the path here itself or get rid of it, re-sync the project and follow the same procedure for linking native project i.e. click on ""Link C++ project with gradle"

like image 58
rsheikh Avatar answered Mar 16 '23 04:03

rsheikh


What you need to do is to manually configure your Gradle file in order to link to your native library in the way you want it and fix whatever you need to fix. You can see the exact directions here: Add C and C++ Code to Your Project, under the 'Manually configure Gradle' section.

like image 35
yakobom Avatar answered Mar 16 '23 03:03

yakobom