Status Update
Comments
ma...@google.com <ma...@google.com>
je...@google.com <je...@google.com>
ka...@google.com <ka...@google.com> #2
I believe you've been looking into this
at com.android.tools.idea.gradle.project.sync.idea.SdkSyncUtil.findMatchingSdkForAddon(SdkSyncUtil.kt:175)
at com.android.tools.idea.gradle.project.sync.idea.SdkSyncUtil.computeSdkReloadingAsNeeded(SdkSyncUtil.kt:127)
da...@gmail.com <da...@gmail.com> #3
hm, in fact let's discuss how we handle SDKs/addons etc. and also bootlclasspath
. We have an open issue with not supporting useLibrary
which we need to fix.
xa...@google.com <xa...@google.com> #4
The issue seems to be in
// Find the path to the android.jar, so we can match this to the sdks and find which one is in use.
val androidJarPath = bootClasspath.map { path ->
File(path)
}.firstOrNull { file ->
file.name == FN_FRAMEWORK_LIBRARY
} ?: return null
// There is no android.jar file in the bootClasspath, we can't find the SDK
// TODO: Maybe log here, this condition should never happen AFAIK.
return allAndroidSdks.first { sdk ->
sdk.rootProvider.getFiles(CLASSES).any { sdkFile ->
filesEqual(virtualToIoFile(sdkFile), androidJarPath)
}
}
i.e. it seems that android.jar
from the bootclasspath (as reported by AGP) is not found in any of Android SDKs registered with the IDE.
Al, do you modify bootclasspath for you project in some way? Also, can you please share a small project that reproduces the issue?
Bradley, you made some changes in this area in the past, does this ring a bell?
pe...@gmail.com <pe...@gmail.com> #5
Unfortunately I can't share that publicly, but would that trigger the issue? Is there some kind of filter on allAndroidSdks which only includes Google sourced SDKs? The reason I'm asking is we've seen issues trying to run apps from AS where our custom SDK is selected, and compiles the code without an issue, but AS pops up a "Please select an Android SDK" error.
to...@gmail.com <to...@gmail.com> #6
This is probably caused by allAndroidSdks
will be empty, and even though there is file with name android.jar
in bootclasspath, the code above will fail?
xa...@google.com <xa...@google.com> #7
ka...@google.com <ka...@google.com> #8
Thanks for confirming that, we'll aim to fix this issue.
an...@google.com <an...@google.com> #9
This will be fixed in upcoming Android Studio Flamingo canaries/betas.
Change: I10b962c387dbac48d047efafddcb7b4d4de3257d
Description
####################################################
Please provide all of the following information, otherwise we may not be able to route your bug report.
####################################################
1. Describe the bug or issue that you're seeing.
Android Studio Ladybug Feature Drop 2024.2.2 Canary 9 does not have the "Clean build" menu option under Build in menubar. This is available in Ladybyg 2024.2.1 Patch 2. I have attached screenshots.
2. Attach log files from Android Studio
2A. In the IDE, select the Help..Collect Logs and Diagnostic Data menu option.
2B. Create a diagnostic report and save it to your local computer.
2C. Attach the report to this bug using the Add attachments button.
3. If you know what they are, write the steps to reproduce:
3A. "Build" > "Clean build" is missing. This is available in 2024.2.1 Patch 2
In addition to logs, please attach a screenshot or recording that illustrates the problem.
For more information on how to get your bug routed quickly, see
Build: AI-242.23339.11.2422.12584204, 202410311828
AS: Ladybug Feature Drop | 2024.2.2 Canary 9
AI-242.23339.11.2422.12584204, JRE 21.0.4+13-b509.17x64 JetBrains s.r.o., OS Mac OS X(aarch64) v14.7, screens 3600x2338 (200%); Retina
Android Gradle Plugin: 8.7.2
Gradle: 8.10.2
Gradle JDK: JetBrains Runtime 21.0.4 - aarch64
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
```