Status Update
Comments
xi...@google.com <xi...@google.com>
ss...@gmail.com <ss...@gmail.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)
ss...@gmail.com <ss...@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.
ss...@gmail.com <ss...@gmail.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?
ss...@gmail.com <ss...@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.
je...@google.com <je...@google.com>
mi...@google.com <mi...@google.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?
Description
We are building a App Bundle and want
lintVitalRelease
to be executed during the build process. The task runs during APK builds with theassembleRelease
task, but it doesn’t run during app bundle builds.For me,
assembleRelease
and bundleRelease are essentially about the same thing – building a complete product ready for publishing in Google Play. Therefore, we’d like the lint to run during bundle builds just as it does during APK builds.STEPS TO REPRODUCE:
./gradlew :app:bundleProdRelease
inVersion of Gradle Plugin: 8.7.1 Version of Gradle: 8.10.2