How do you rename a jni in Android Studio

Issue

If you create a C++ project in Android Studio (JNI) and then attempt to rename the jni from the default of native-lib.cpp to another name, the file disappears from the Android Hierarchy. What is the proper way to refactor/rename this file?

Solution

@Vidz answered this:

Android Studio -> Right click on native_lib.cpp file -> Refactor -> Rename as XYZ.cpp -> File name will be renamed -> CamkeList will be updated for the updated file name. If you change the view from Android to Project Explorer, modified will be seen. If not seen, you may try File -> Invalidate cache and restart -> File should be visible now – Vidz Jan 2 at 13:26

Answered By – justdan0227

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published