skip to Main Content

Last time I was careless to updated Android Studio to the latest realease:

Android Studio Arctic Fox | 2020.3.1
Build #AI-203.7717.56.2031.7583922, built on July 27, 2021

Then all the cpp files disappeared in my project navigator in Android session:
enter image description here

I can only see the jni folder and a jni.cpp file in Project session:
enter image description here
and all other cpp files in cpp folder missed. I have tried to delete all CMakeCache.txt files in directory .externalNativeBuild but it does not work, my gradle is as follows:

    externalNativeBuild {
        cmake {
            path "../../../CMakeLists.txt"
        }
    }

And the building system still compiles these cpp files. Who can help me out? or should I downgrade to original version?

2

Answers


  1. This answer is not quite answering the exact question, but I found if you want to just show your JNI files again in Android Studio do this –

    Create an empty Android_dummy.mk file, then add this to your gradle:

    externalNativeBuild {
        ndkBuild {
            path file('src/main/jni/Android_dummy.mk')
        }
    }
    

    I needed this as I build the libraries outside AS manually with ndk-build

    Login or Signup to reply.
  2. to add CPP folder again.

    externalNativeBuild {
            cmake {
                path file('src/main/cpp/CMakeLists.txt')
            }
        }
    

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search