You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exclude .cxx folders from git as part of the flutter create templates. #160372
I believe that an unintended side effect of #160260 is that we are seeing more native bin directories when working with apps.
This bug tracks updating the templates. As an aside the blog post for the next release might want to warn about this and we want to update our own repos to exclude this folder.
Do you know what circumstances cause these cxx directories to appear? I tried building the examples/flutter_view app, as well as a new sample app from templates, and didn't see them.
Do you know what circumstances cause these cxx directories to appear? I tried building the examples/flutter_view app, as well as a new sample app from templates, and didn't see them.
This directory is created only when I run the app in profile or release mode on a real device. It doesn't show up when building the app with flutter build
For us with the Zulip app at https://github.com/zulip/zulip-flutter, flutter build apk is enough to make an android/app/.cxx/ directory appear. So is flutter build apk --debug, and so is flutter run targeting an Android device.
The previous Flutter commit we were using was 1c1f357 from Dec 8, and with that version we didn't have this symptom. (Now we're using 65ff060 which is from Dec 23, later than the reports above.)
Because the directory has a ton of files in it, having it present without being in .gitignore produces an alarming amount of "new files" output for our contributors using VS Code. So I agree it should probably get mentioned in the blog post and release notes — people are definitely going to notice, and it's best if they feel they were forewarned.
That directory is where that commit's stub CMakeLists.txt goes. And those two flags at the end are a match for those added in that code:
externalNativeBuild {
cmake {
// CMake will print warnings when you try to build an empty project.// These arguments silence the warnings - our project is intentionally// empty.
arguments("-Wno-dev", "--no-warn-unused-cli")
}
I am suddenly getting configure_fingerprint.bin files from android/app/.cxx/RelWithDebInfo added to my repository. Not sure which change caused this unfortunately, but I recently did the following:
Upgraded to Flutter 3.29
Upgraded Kotlin to 2.1.10
Upgraded Gradle plugin to 8.8.0
gradle-wrapper.properties to gradle-8.10.2-all.zip
I read a lot of github issues related to this. Everyone stated the obvious of adding to .gitignore. I have done that.
I did not find a discussion about build artifacts in our source code folders. So if I run 'flutter clean', this build artifact remains. Only method to is to remove it manually. This is bad design and hopefully someone will figure out how to move it to the build directory
android/app/.cxx should not exist, it is a build tools failure
I read a lot of github issues related to this. Everyone stated the obvious of adding to .gitignore. I have done that.
I did not find a discussion about build artifacts in our source code folders. So if I run 'flutter clean', this build artifact remains. Only method to is to remove it manually. This is bad design and hopefully someone will figure out how to move it to the build directory
android/app/.cxx should not exist, it is a build tools failure
I read a lot of github issues related to this. Everyone stated the obvious of adding to .gitignore. I have done that.
I did not find a discussion about build artifacts in our source code folders. So if I run 'flutter clean', this build artifact remains. Only method to is to remove it manually. This is bad design and hopefully someone will figure out how to move it to the build directory
android/app/.cxx should not exist, it is a build tools failure
Interestingly it looks like the AGP maintainers sort of disagree, and explicitly say not to to put the external native build output directory in your projects temporary build directory. I think it probably isn't a problem for us, though, as we aren't actually building anything anyways (we are just tricking AGP into downloading the NDK).
Put up #166277 to move the build staging directory to within the build/ directory.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Ignore cxx folders for all of flutter/flutter (#160381)
gmackall commentedon Dec 17, 2024
Do you know what circumstances cause these
cxxdirectories to appear? I tried building theexamples/flutter_viewapp, as well as a new sample app from templates, and didn't see them.reidbaker commentedon Dec 17, 2024
They showed up while I was working on a different pr that was opened in android studio. Specifically dev/integration_test/display_cutout_rotation
reidbaker commentedon Dec 17, 2024
Also I didnt check if the cxx directories stopped showing up without your pr. It was only a guess on my part.
khoadng commentedon Dec 19, 2024
This directory is created only when I run the app in profile or release mode on a real device. It doesn't show up when building the app with
flutter buildgnprice commentedon Dec 27, 2024
For us with the Zulip app at https://github.com/zulip/zulip-flutter,
flutter build apkis enough to make anandroid/app/.cxx/directory appear. So isflutter build apk --debug, and so isflutter runtargeting an Android device.The previous Flutter commit we were using was 1c1f357 from Dec 8, and with that version we didn't have this symptom. (Now we're using 65ff060 which is from Dec 23, later than the reports above.)
Because the directory has a ton of files in it, having it present without being in
.gitignoreproduces an alarming amount of "new files" output for our contributors using VS Code. So I agree it should probably get mentioned in the blog post and release notes — people are definitely going to notice, and it's best if they feel they were forewarned.gnprice commentedon Dec 27, 2024
Also I think the
hash_key.txtfile inside the generated directory confirms this is indeed due to the logic added in #160260 / 2948917 :That directory is where that commit's stub CMakeLists.txt goes. And those two flags at the end are a match for those added in that code:
externalNativeBuild { cmake { // CMake will print warnings when you try to build an empty project. // These arguments silence the warnings - our project is intentionally // empty. arguments("-Wno-dev", "--no-warn-unused-cli") }gitignore: Ignore CMake directory generated on Android build
gitignore: Ignore CMake directory generated on Android build
gmackall commentedon Jan 2, 2025
Looks like these are also gitignored in a new (pure) Android project created from Android Studio, example
https://github.com/gmackall/help_w_a2a/blob/main/host_app/.gitignore#L14.
Adding to the templates sounds correct to me, and I'll draft a section for the blog post.
[Android] Add `.cxx` directories to app template `.gitignore` (#161069)
5 remaining items
Update integration test and benchmark Android .gitignore files to mat…
corepuncher commentedon Feb 22, 2025
I am suddenly getting configure_fingerprint.bin files from android/app/.cxx/RelWithDebInfo added to my repository. Not sure which change caused this unfortunately, but I recently did the following:
Ignoring .cxx folders
Ignore .cxx directory
Android用の.gitignoreファイルに「**/.cxx/」を追加しました。
gasaichandesu commentedon Mar 28, 2025
j3g commentedon Mar 29, 2025
I read a lot of github issues related to this. Everyone stated the obvious of adding to .gitignore. I have done that.
I did not find a discussion about build artifacts in our source code folders. So if I run 'flutter clean', this build artifact remains. Only method to is to remove it manually. This is bad design and hopefully someone will figure out how to move it to the build directory
android/app/.cxx should not exist, it is a build tools failure
gmackall commentedon Mar 30, 2025
This is a good point. I think we can configure this with https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/Cmake#buildStagingDirectory(kotlin.Any)
gmackall commentedon Mar 31, 2025
Interestingly it looks like the AGP maintainers sort of disagree, and explicitly say not to to put the external native build output directory in your projects temporary
builddirectory. I think it probably isn't a problem for us, though, as we aren't actually building anything anyways (we are just tricking AGP into downloading the NDK).Put up #166277 to move the build staging directory to within the
build/directory.Move `.cxx` directory out of `android/app` (#166277)
github-actions commentedon Apr 15, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.Move `.cxx` directory out of `android/app` (flutter#166277)
Move `.cxx` directory out of `android/app` (flutter#166277)