Fixed
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Canary 3
- Android Gradle Plugin 8.8.0-alpha03
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ej...@gmail.com <ej...@gmail.com> #3
The first does:
return getTotalLocalFileSize(f.listFiles()) + 1;
Instead of:
count += getTotalLocalFileSize(f.listFiles()) + 1;
for directories, which means it breaks the loop, ignoring the value of count and any other files or directories that might be in the array.
return getTotalLocalFileSize(f.listFiles()) + 1;
Instead of:
count += getTotalLocalFileSize(f.listFiles()) + 1;
for directories, which means it breaks the loop, ignoring the value of count and any other files or directories that might be in the array.
uc...@google.com <uc...@google.com>
je...@google.com <je...@google.com>
sp...@google.com <sp...@google.com>
sp...@google.com <sp...@google.com>
an...@google.com <an...@google.com> #5
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Canary 2
- Android Gradle Plugin 8.8.0-alpha02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
since it will return the size of the first directory instead of adding it to the total count.
private int getTotalLocalFileSize(File[] files) {
int count = 0;
for (File f : files) {
if (f.exists()) {
if (f.isDirectory()) {
return getTotalLocalFileSize(f.listFiles()) + 1;
} else if (f.isFile()) {
count += f.length();
}
}
}
return count;
}
Should be:
private int getTotalLocalFileSize(File[] files) {
int count = 0;
for (File f : files) {
if (f.exists()) {
if (f.isDirectory()) {
count += getTotalLocalFileSize(f.listFiles()) + 1;
} else if (f.isFile()) {
count += f.length();
}
}
}
return count;
}
Android Plugin Version: 3.1.0
com.android.tools.ddms:ddmlib:26.1.0