Status Update
Comments
ch...@oqee.tv <ch...@oqee.tv> #2
EDIT: meant TypedArray#recycle
and not TypedArray#release
sp...@google.com <sp...@google.com>
sa...@google.com <sa...@google.com>
db...@coyote-group.com <db...@coyote-group.com> #3
Lint should show a warning in this case, as implements AutoClosable
and the use of TypedArray#close()
require API level 31. Consequently the IDE should also not suggest the refactor to try with resources unless minSdk
is at least 31.
Maybe the issue is that api-versions.xml
(from platforms/android-33/data/api-versions.xml
) only mention implements AutoClosable
, and not the close()
method
<class name="android/content/res/TypedArray" since="1">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="31"/>
<method name="getBoolean(IZ)Z"/>
<method name="getChangingConfigurations()I" since="21"/>
<method name="getColor(II)I"/>
<method name="getColorStateList(I)Landroid/content/res/ColorStateList;"/>
<method name="getDimension(IF)F"/>
<method name="getDimensionPixelOffset(II)I"/>
<method name="getDimensionPixelSize(II)I"/>
<method name="getDrawable(I)Landroid/graphics/drawable/Drawable;"/>
<method name="getFloat(IF)F"/>
<method name="getFont(I)Landroid/graphics/Typeface;" since="26"/>
<method name="getFraction(IIIF)F"/>
<method name="getIndex(I)I"/>
<method name="getIndexCount()I"/>
<method name="getInt(II)I"/>
<method name="getInteger(II)I"/>
<method name="getLayoutDimension(II)I" since="3"/>
<method name="getLayoutDimension(ILjava/lang/String;)I"/>
<method name="getNonResourceString(I)Ljava/lang/String;"/>
<method name="getPositionDescription()Ljava/lang/String;"/>
<method name="getResourceId(II)I"/>
<method name="getResources()Landroid/content/res/Resources;"/>
<method name="getSourceResourceId(II)I" since="29"/>
<method name="getString(I)Ljava/lang/String;"/>
<method name="getText(I)Ljava/lang/CharSequence;"/>
<method name="getTextArray(I)[Ljava/lang/CharSequence;"/>
<method name="getType(I)I" since="21"/>
<method name="getValue(ILandroid/util/TypedValue;)Z"/>
<method name="hasValue(I)Z"/>
<method name="hasValueOrEmpty(I)Z" since="22"/>
<method name="length()I"/>
<method name="peekValue(I)Landroid/util/TypedValue;"/>
<method name="recycle()V"/>
</class>
Opened TypedArray#close()
to TypedArray#recycle()
, to make try with resources for TypedArray
supported on all API levels.
al...@sz.de <al...@sz.de> #4
Checked api-versions.xml
for more occurrences where implements AutoCloseable
was added together with a close
method after 19 where AutoCloseable
was introduced, and found
<class name="android/content/ContentProviderClient" since="5">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="24"/>
close
also added in 24, as an alias for release
.
<class name="android/drm/DrmManagerClient" since="11" deprecated="30">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="24"/>
close
also added in 24, as an alias for release
.
<class name="android/media/MediaDrm" since="18">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="28"/>
close
also added in 28, as an alias for release
.
<class name="android/media/MediaMetadataRetriever" since="10">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="29"/>
close
also added in 29, as an alias for release
.
<class name="android/net/wifi/p2p/WifiP2pManager$Channel" since="14">
<extends name="java/lang/Object"/>
<implements name="java/lang/AutoCloseable" since="27"/>
close
also added in 27, but not as an alias, as there was no similar method before (actually close
is the only method).
Opened
sh...@gmail.com <sh...@gmail.com> #5
I forgot to mark this bug when this was fixed last week, by this CL:
It's fixed in Giraffe/8.1 but I think we should backport it to Flamingo/8.0 as well.
Søren, it sounds like you want to start desugaring these methods (good idea); maybe there should be a different tracking issue for that.
hu...@google.com <hu...@google.com> #6
Thanks Tor. I have
hu...@google.com <hu...@google.com>
hu...@google.com <hu...@google.com> #7
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 Giraffe Canary 1 (2022.3.1.1)
- Android Gradle Plugin 8.1.0
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!
ch...@oqee.tv <ch...@oqee.tv> #8
Hi,
The TimeoutException
is not just a warning, it's an error that breaks tests.
hu...@google.com <hu...@google.com> #9
This particular TimeoutException is thrown from
an...@google.com <an...@google.com> #10
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 Narwhal | 2025.1.1 Canary 3
- Android Gradle Plugin 8.11.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!
Description
DESCRIBE THE ISSUE IN DETAIL:
It's working well locally, but when running it in GitLab CI some tests fail with the error
java.util.concurrent.TimeoutException: Slow render action
STEPS TO REPRODUCE:
Stacktrace:
Studio Build: Build #AI-242.20224.300.2421.12293307, built on August 29, 2024
Version of Gradle Plugin: 8.5.2
Version of Gradle: gradle-8.7
Version of Compose Screenshot plugin: com.android.compose.screenshot:0.0.1-alpha05