Annotation
This table lists all the artifacts in the androidx.annotation group.
| Artifact | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| annotation | 1.9.1 | - | - | - |
| annotation-experimental | 1.5.1 | - | - | 1.6.0-alpha01 |
Declaring dependencies
To add a dependency on Annotation, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { implementation "androidx.annotation:annotation:1.9.1" // To use the Java-compatible @androidx.annotation.OptIn API annotation implementation "androidx.annotation:annotation-experimental:1.5.1" }
Kotlin
dependencies { implementation("androidx.annotation:annotation:1.9.1") // To use the Java-compatible @androidx.annotation.OptIn API annotation implementation("androidx.annotation:annotation-experimental:1.5.1") }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
Version 1.9
Version 1.9.1
October 30, 2024
androidx.annotation:annotation-*:1.9.1 is released. Version 1.9.1 contains these commits.
Bug Fixes
Version 1.9.0
October 16, 2024
androidx.annotation:annotation-*:1.9.0 is released. Version 1.9.0 contains these commits.
Important changes since 1.8.0
- Added support for the following Kotlin Multiplatform targets:
watchosDeviceArm64,mingwX64,linuxArm64.
Version 1.9.0-rc01
October 2, 2024
androidx.annotation:annotation-*:1.9.0-rc01 is released. Version 1.9.0-rc01 contains no changes since the previous beta.
Version 1.9.0-beta01
September 18, 2024
androidx.annotation:annotation-*:1.9.0-beta01 is released. Version 1.9.0-beta01 contains these commits.
API Changes
- Adds support for
watchosDeviceArm64platform target (I1cc04, b/364652024)
Version 1.9.0-alpha03
September 4, 2024
androidx.annotation:annotation-*:1.9.0-alpha03 is released. Version 1.9.0-alpha03 contains no changes since the previous alpha.
Version 1.9.0-alpha02
August 21, 2024
androidx.annotation:annotation-*:1.9.0-alpha02 is released. Version 1.9.0-alpha02 contains these commits.
New Features
- Adding support for
mingwX64platform (I461ca, b/349894318) - Add support for
linuxArm64kotlin multiplatform target. (I139d3, b/338268719)
Version 1.9.0-alpha01
June 26, 2024
androidx.annotation:annotation-*:1.9.0-alpha01 is released. Version 1.9.0-alpha01 contains these commits.
External Contribution
- Adds support for
linuxArm64multiplatform target (thanks to Jake Wharton!)
Version 1.8
Version 1.8.2
August 7, 2024
androidx.annotation:annotation-*:1.8.2 is released. Version 1.8.2 contains these commits.
Bug Fixes
- Adding support for
mingwX64platform (I461ca, b/349894318)
Version 1.8.1
July 24, 2024
androidx.annotation:annotation-*:1.8.1 is released. Version 1.8.1 contains these commits.
Bug Fixes
- Includes additional Kotlin Multiplatform targets:
watchos,tvos.
Version 1.8.0
May 14, 2024
androidx.annotation:annotation-*:1.8.0 is released. Version 1.8.0 contains these commits.
Important changes since 1.7.0
- Added
@ReplaceWithannotation to express replacements for deprecated APIs - The
@MainThreadannotation has been moved to the common source set.
Version 1.8.0-rc01
May 1, 2024
androidx.annotation:annotation-*:1.8.0-rc01 is released. Version 1.8.0-rc01 contains no changes since the prior beta release.
Version 1.8.0-beta02
April 17, 2024
androidx.annotation:annotation-*:1.8.0-beta02 is released. Version 1.8.0-beta02 contains no changes since the prior release.
Version 1.8.0-beta01
April 3, 2024
androidx.annotation:annotation-*:1.8.0-beta01 is released. Version 1.8.0-beta01 contains these commits.
New Features
ReplaceWithannotation is now API-stable, but the associated lint check with auto-fix has not shipped yet
Version 1.8.0-alpha02
March 20, 2024
androidx.annotation:annotation-*:1.8.0-alpha02 is released with no notable changes. Version 1.8.0-alpha02 contains these commits.
Version 1.8.0-alpha01
February 21, 2024
androidx.annotation:annotation-*:1.8.0-alpha01 is released. Version 1.8.0-alpha01 contains these commits.
API Changes
- Added
@ReplaceWithannotation to express replacements for deprecated APIs. (I38db3, b/322373864)
External Contributions
- Thanks Ivan Matkov for moving the
@MainThreadannotation to the common source set. (6f228c)
Version 1.7
Version 1.7.1
December 13, 2023
androidx.annotation:annotation-*:1.7.1 is released. Version 1.7.1 contains these commits.
Bug Fixes
- Use
compilescope when inserting default platform dependency. (I4958f)
Version 1.7.0
September 6, 2023
androidx.annotation:annotation-*:1.7.0 is released. Version 1.7.0 contains these commits.
Important changes since 1.6.0
- Includes Kotlin Multiplatform artifacts targeting iOS, Linux, and MacOS platforms.
- You can now use Annotations in KMM projects. Note that non-Android targets of Annotations are still experimental but we decided to merge versions to make it easier for developers to try them. Specifically, some annotations might move between common and platform specific code during the alpha development as we finalize the boundaries.
Version 1.7.0-rc01
August 23, 2023
androidx.annotation:annotation-*:1.7.0-rc01 is released. Version 1.7.0-rc01 contains these commits.
This release does not contain any changes from the prior beta.
Version 1.7.0-beta01
August 9, 2023
androidx.annotation:annotation-*:1.7.0-beta01 is released. Version 1.7.0-beta01 contains these commits.
New Features
- Stabilized APIs for release
Version 1.7.0-alpha03
July 26, 2023
androidx.annotation:annotation-*:1.7.0-alpha03 is released. Version 1.7.0-alpha03 contains these commits.
Bug Fixes
- Maven POM publication now includes default JVM-targeted multiplatform artifact as dependency
Version 1.7.0-alpha02
March 24, 2023
androidx.annotation:annotation-*:1.7.0-alpha02 is released.
Bug Fixes
- Removed dependency constraints from Maven artifacts to workaround a build problem in Kotlin Native Targets (b/274786186, KT-57531).
Version 1.7.0-alpha01
March 22, 2023
androidx.annotation:annotation-*:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.
New Features
- Includes Kotlin Multiplatform artifacts targeting iOS, Linux, and MacOS platforms.
- You can now use Annotations in KMM projects. Note that non-Android targets of Annotations are still experimental but we decided to merge versions to make it easier for developers to try them. Specifically, some annotations might move between common and platform specific code during the alpha development as we finalize the boundaries.
Version 1.6
Version 1.6.0
February 22, 2023
androidx.annotation:annotation:1.6.0 and androidx.annotation:annotation-jvm:1.6.0 are released. Version 1.6.0 contains these commits.
Important changes since 1.5.0
- Adds a
@RequiresExtensionannotation to express that an API requires a particular version of a particular extension SDK (I5e4fe) - Converted annotation library to build using the Kotlin Multiplatform toolchain (I3be8d)
Version 1.6.0-rc01
February 8, 2023
androidx.annotation:annotation:1.6.0-rc01 and androidx.annotation:annotation-jvm:1.6.0-rc01 are released. Version 1.6.0-rc01 contains these commits.
- Annotation has been stabilized for release candidate 1.6.0-rc01.
Version 1.6.0-beta01
January 25, 2023
androidx.annotation:annotation:1.6.0-beta01 and androidx.annotation:annotation-jvm:1.6.0-beta01 are released with no changes from 1.6.0-alpha01.
Version 1.6.0-alpha01
January 11, 2023
androidx.annotation:annotation-*:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
Version 1.6.0-dev01
February 8, 2023
androidx.annotation:annotation-*:1.6.0-dev01 is released. Version 1.6.0-dev01 contains these commits.
- Annotation has enabled Kotlin multi-platform for developer preview 1.6.0-dev01.
New Features
- Adds a
@RequiresExtensionannotation to express that an API requires a particular version of a particular extension SDK. (I5e4fe) - Converted annotation library to build using the Kotlin Multiplatform toolchain (I3be8d)
Version 1.5.0
Version 1.5.0
September 21, 2022
androidx.annotation:annotation:1.5.0 is released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- Annotation library has been fully migrated to Kotlin sources, resulting in support for Kotlin-specific target use sites and other Kotlin-compatible annotation features.
Version 1.5.0-rc01
September 7, 2022
androidx.annotation:annotation:1.5.0-rc01 is released. Version 1.5.0-rc01 contains these commits.
- No changes from previous 1.5.0 beta release.
Version 1.5.0-beta01
August 24, 2022
androidx.annotation:annotation:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
- No changes from previous release. API surface has been frozen for beta.
Version 1.5.0-alpha02
August 10, 2022
androidx.annotation:annotation:1.5.0-alpha02 is released. Version 1.5.0-alpha02 contains these commits.
- No changes since the previous alpha release.
Version 1.5.0-alpha01
July 27, 2022
androidx.annotation:annotation:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.
New Features
- Annotation library has been fully migrated to Kotlin sources, resulting in support for Kotlin-specific target use sites and other Kotlin-compatible annotation features.
Version 1.4.0
Version 1.4.0
June 15, 2022
androidx.annotation:annotation:1.4.0 is released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
@RestrictTohas been migrated to Kotlin sources and now supports@fileusage site. As a result, the Annotation library now depends on the Kotlin standard library.@ReturnThis(b/140249763): Ensures that overriding methods of this method must return the same instance (intended for builders etc)@OpenForTesting(b/141539024): Kotlin classes and methods marked "open" can be annotated with this annotation, and lint will make sure that this class is only subclassed (and methods only overridden) from unit tests@DeprecatedSinceApi(b/37116481): Indicates that the annotated method (or class or field) is part of a backport library for a platform API, which is no longer needed as of the given API level.@EmptySuper: Indicates that this method is defined to be empty, so when overriding you do not need to call it (and in fact you shouldn't; for example, it can contain backwards compatibility checking.)
Version 1.4.0-rc01
June 1, 2022
androidx.annotation:annotation:1.4.0-rc01 is released. Version 1.4.0-rc01 contains these commits.
- API surface and functionality have been finalized for release.
Version 1.4.0-beta01
May 18, 2022
androidx.annotation:annotation:1.4.0-beta01 is released. Version 1.4.0-beta01 contains these commits.
- No changes since the last alpha. API surface has been locked down for Beta release.
Version 1.4.0-alpha02
February 9, 2022
androidx.annotation:annotation:1.4.0-alpha02 is released. Version 1.4.0-alpha02 contains these commits.
New Features
Added
@ReturnThis,@OpenForTesting,@EmptySuperand@DeprecatedSinceApiannotations. (21946a2)@ReturnThis(b/140249763): Ensures that overriding methods of this method must return the same instance (intended for builders etc)@OpenForTesting(b/141539024): Kotlin classes and methods marked "open" can be annotated with this annotation, and lint will make sure that this class is only subclassed (and methods only overridden) from unit tests@DeprecatedSinceApi(b/37116481): Indicates that the annotated method (or class or field) is part of a backport library for a platform API, which is no longer needed as of the given API level.@EmptySuper: Indicates that this method is defined to be empty, so when overriding you do not need to call it (and in fact you shouldn't; for example, it can contain backwards compatibility checking.)
Version 1.4.0-alpha01
December 15, 2021
androidx.annotation:annotation:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
API Changes
- Migrated
RestrictToannotation to Kotlin sources (Ia6336)
Version 1.3.0
Version 1.3.0
November 3, 2021
androidx.annotation:annotation:1.3.0 is released. Version 1.3.0 contains these commits.
Important changes since 1.2.0
@Discouragedannotation for marking APIs that cannot be reasonably deprecated but have significant negative performance impact and should not be called in normal production code@Contextannotation to mark generic Contexts so that developers can migrate to new APIs more easily@GravityIntannotation for marking elements containing gravity values packed into integers- Deprecated
@InspectablePropertyin favor of@Attributeforandroidx.resourceinspection
Version 1.3.0-rc01
October 27, 2021
androidx.annotation:annotation:1.3.0-rc01 is released. Version 1.3.0-rc01 contains these commits.
Version 1.3.0-beta01
September 29, 2021
androidx.annotation:annotation:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
API Changes
- Require explanation in 'message' for @Discouraged. (I3390f)
- Adding @Discouraged annotation for marking elements that are discouraged. (Ib2549)
- Make the RestrictTo annotation visible from Studio docs popup (Ie8e1a, b/183134648)
Bug Fixes
- Add Context annotation to mark generic Contexts, so developers can migrate to new APIs more easily. (Ie581a)
Version 1.3.0-alpha01
March 24, 2021
androidx.annotation:annotation:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Deprecated
@InspectablePropertyin favor of@Attributeinandroidx.resourceinspection. (Ic0eff) - Added
@GravityIntannotation for marking elements containing gravity values packed into integers. (Ifcaa4, b/180620048)
Annotation-Experimental Version 1.6
Version 1.6.0-alpha01
October 22, 2025
androidx.annotation:annotation-experimental:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
API Changes
- The
OptInannotation now supports theElementType.PARAMETERtarget.
Annotation-Experimental Version 1.5
Version 1.5.1
July 16, 2025
androidx.annotation:annotation-experimental:1.5.1 is released. Version 1.5.1 contains these commits.
Version 1.5.0
May 7, 2025
androidx.annotation:annotation-experimental:1.5.0 is released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- Added
messagetoRequiresOptInto match the Kotlin stdlib annotation with default empty string value. (I1f50e) - This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer. (Idb6b5)
Version 1.5.0-rc01
April 23, 2025
androidx.annotation:annotation-experimental:1.5.0-rc01 is released. Version 1.5.0-rc01 contains no changes since the previous beta release, see commits.
Version 1.5.0-beta01
April 9, 2025
androidx.annotation:annotation-experimental:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
Important changes
- This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer (Idb6b5)
Version 1.5.0-alpha01
August 21, 2024
androidx.annotation:annotation-experimental:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.
API Changes
- Add
messagetoRequiresOptInto match the Kotlin stdlib annotation with default empty string value. (I1f50e)
Annotation-Experimental Version 1.4
Version 1.4.1
April 3, 2024
androidx.annotation:annotation-experimental:1.4.1 is released. Version 1.4.1 contains these commits.
Bug Fixes
- Fix usage of
isKotlinto avoid accidentally triggeringRequiresOptIncheck in Kotlin files. (I2d8c1f)
Version 1.4.0
January 24, 2024
androidx.annotation:annotation-experimental:1.4.0 is released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
- Add support for Kotlin multi-platform
- Fix compatibility with Kotlin 2.0
- Show warnings for Java usages of experimentally-annotated Kotlin properties (I8bd43)
- Fix placement of autofix annotation on Kotlin methods (Id7a41)
Version 1.4.0-rc01
January 10, 2024
androidx.annotation:annotation-experimental:1.4.0-rc01 is released. Version 1.4.0-rc01 contains no changes since the previous release.
Version 1.4.0-beta01
December 13, 2023
androidx.annotation:annotation-experimental:1.4.0-beta01 is released. There are no changes since the previous release.
Version 1.4.0-alpha01
November 29, 2023
androidx.annotation:annotation-experimental:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
Bug Fixes
- Temporarily remove class-level autofix suggestions to work around b/301598518. (Id98b2)
- Show warnings for Java usages of experimentally-annotated Kotlin properties (I8bd43)
- Fix placement of autofix annotation on Kotlin methods (Id7a41)
Version 1.4.0-dev01
February 8, 2023
androidx.annotation:annotation-experimental:1.4.0-dev01 is released. Version 1.4.0-dev01 contains these commits.
- Annotation-experimental has enabled Kotlin multi-platform for developer preview 1.4.0-dev01.
Annotation-Experimental Version 1.3.1
Version 1.3.1
June 21, 2023
androidx.annotation:annotation-experimental:1.3.1 is released. Version 1.3.1 contains these commits.
Bug Fixes
- Place annotation at the beginning of the modifier list when applying lint auto-fix. (b/251172715)
- Use lint check to discourage use of
androidx.annotation.RequiresOptInin Kotlin sources (b/241097743)
Annotation-Experimental Version 1.3.0
Version 1.3.0
September 7, 2022
androidx.annotation:annotation-experimental:1.3.0 is released. Version 1.3.0 contains these commits.
Important changes since 1.2.0
- Add support for package-level use of
@androidx.annotation.OptIn(I24d58) - Moved Kotlin stdlib dependency to API-type, rather than compile-only. This means all clients of the Annotation-Experimental library will include the Kotlin standard library in their transitive dependencies.
Version 1.3.0-rc01
August 24, 2022
androidx.annotation:annotation-experimental:1.3.0-rc01 is released. Version 1.3.0-rc01 contains these commits.
- No changes from the previous release. Implementation has been frozen for RC.
Version 1.3.0-beta01
August 10, 2022
androidx.annotation:annotation-experimental:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
- No changes from alpha. This library has been stabilized for beta release.
Version 1.3.0-alpha01
July 27, 2022
androidx.annotation:annotation-experimental:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
API Changes
- Add support for package-level use of
@androidx.annotation.OptIn(I24d58)
Annotation-Experimental Version 1.2.0
Version 1.2.0
December 15, 2021
androidx.annotation:annotation-experimental:1.2.0 is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
This library is now targeting Java 8 language level.
Version 1.2.0-rc01
December 1, 2021
androidx.annotation:annotation-experimental:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
No changes from beta.
Version 1.2.0-beta01
November 17, 2021
androidx.annotation:annotation-experimental:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
API Changes
APIs have been finalized for beta.
Annotation-Experimental Version 1.2.0-alpha01
June 30, 2021
androidx.annotation:annotation-experimental:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
New Features
- Library is now targeting Java 8 language level
Version 1.2.0
Version 1.2.0
March 24, 2021
androidx.annotation:annotation:1.2.0 is released. Version 1.2.0 contains these commits.
Major changes since 1.1.0
- Added
@ChecksSdkIntAtLeastannotation, which can be used to identify methods or fields used to gate access on SDK level and satisfy theNewApilint check. - Added
@DoNotInlineannotation, which is paired with a Proguard rule to prevent members from being inlined during optimization. - A variety of annotations are now annotated with
@Documentedto ensure they show up in documentation for annotated members.
Version 1.2.0-rc01
February 24, 2021
androidx.annotation:annotation:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
Version 1.2.0-beta01
January 13, 2021
androidx.annotation:annotation:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
API Changes
- New
@DoNotInlineannotation which instructs code optimizers (e.g. Proguard, R8) to not inline the annotated method. (I3dfe8, b/141326133)
Version 1.2.0-alpha01
May 14, 2020
androidx.annotation:annotation:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
New Features
- Added
@ChecksSdkIntAtLeastannotation. This let’s androidx and users annotate methods and fields that represent anSDK_INTcheck. (I89a54, b/120255046)
Annotation-Experimental Version 1.1.0
Version 1.1.0
April 7, 2021
androidx.annotation:annotation-experimental:1.1.0 is released. Version 1.1.0 contains these commits.
Major changes since 1.0.0
- Jetpack’s experimental annotations have been rewritten in Kotlin to provide support for multiple marker classes and improved handling of deprecation.
RequiresOptInandOptInannotations have been added for parity with Kotlin, and theExperimentalandUsesExperimentalannotations have been deprecated.
Version 1.1.0-rc02
March 24, 2021
androidx.annotation:annotation-experimental:1.1.0-rc02 is released. Version 1.1.0-rc02 contains these commits.
Bug Fixes
- Added Proguard rules to ensure that code optimization does not warn about missing Kotlin meta-annotations.
Version 1.1.0-rc01
March 10, 2021
androidx.annotation:annotation-experimental:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
No changes since prior beta release.
Version 1.1.0-beta01
January 27, 2021
androidx.annotation:annotation-experimental:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
API Changes
- The androidx variant of the Experimental annotation has been deprecated to provide parity with Kotlin. It has been replaced by an androidx variant of the RequiresOptIn annotation, and the Java-facing linter has been updated to support both the new Kotlin annotation and the new androidx variant. (I52495, b/151331381)
Version 1.1.0-alpha01
July 22, 2020
androidx.annotation:annotation-experimental:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
New Features
- Experimental annotation library is now written in Kotlin, but does not require the Kotlin standard library to be included as a dependency. It includes a Proguard file that allows unnecessary Kotlin metadata to be stripped from projects that only use the Java programming language.
@UseExperimentalnow supports multiple marker classes (aosp/1185577, b/145137892)
Annotation-Experimental Version 1.0.0
Annotation-Experimental Version 1.0.0
November 7, 2019
androidx.annotation:annotation-experimental:1.0.0 and androidx.annotation:annotation-experimental-lint:1.0.0 is released with no changes since 1.0.0-rc01. Version 1.0.0 contains these commits.
Major features of 1.0.0
- Lint-based enforcement of Kotlin
@Experimentalsemantics in Java source code - Java annotations that provide equivalent behavior to Kotlin’s
@Experimentaland@UseExperimentalannotations without the need for a dependency on Kotlin
Annotation-Experimental Version 1.0.0-rc01
October 23, 2019
androidx.annotation:annotation-experimental:1.0.0-rc01 and androidx.annotation:annotation-experimental-lint:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.
Known issues
When using Studio 3.5 stable, warnings from the @Experimental usage lint detector are not displayed in the IDE for invalid Java usages of Kotlin @Experimental annotation. See b/140640322.
Annotation-Experimental Version 1.0.0-beta01
October 9, 2019
androidx.annotation:annotation-experimental:1.0.0-beta01 and androidx.annotation:annotation-experimental-lint:1.0.0-beta01 are released with no changes since version 1.0.0-alpha01. Version 1.0.0-beta01 contains these commits.
Annotation-Experimental Version 1.0.0-alpha01
September 18, 2019
androidx.annotation:annotation-experimental:1.0.0-alpha01 and androidx.annotation:annotation-experimental-lint:1.0.0-alpha01 are released. These are the commits included in annotation-experimental 1.0.0-alpha01 and these are the commits included in annotation-experimental-lint 1.0.0-alpha01
New features
The Jetpack Experimental annotation library provides a Java-compatible implementation of Kotlin’s experimental API markers. The
-lintartifact provides a Lint-based implementation of experimental usage restrictions and enforces restrictions on Java usages of Kotlin’s native experimental API markers.When using the
annotation-experimentalartifact as a dependency, the Lint rules provided by theannotation-experimental-lintartifact will be enforced automatically.
Version 1.1.0
Version 1.1.0
June 5, 2019
androidx.annotation:annotation:1.1.0 is released with no changes from 1.1.0-rc01.
Version 1.1.0-rc01
May 7, 2019
androidx.annotation:annotation:1.1.0-rc01 is released with no changes from 1.1.0-beta01. The commits included in this version can be found here.
Version 1.1.0-beta01
April 3rd, 2019
androidx.annotation:annotation:1.1.0-beta01 is released. The commits included in this version can be found here.
New features
- New
@InspectablePropertyannotation to support the new view inspection APIs added in Android 10. This annotation can be applied to getters on views or other UI elements. Code generation tools may use it to create companion objects that map property names and attribute IDs to property values without the overhead of reflection.
API changes
- Breaking change:
@ContentViewhas been changed to a constructor annotation and the@LayoutResvalue has been removed. Classes wishing to support@ContentViewannotations should add this annotation to a constructor that takes a@LayoutRes intparameter. This fixes an issue when using this annotation in library modules. (b/128352521)
Version 1.1.0-alpha02
March 13, 2019
androidx.annotation:annotation:1.1.0-alpha02 is released. The full list of commits included
in this version can be found here.
New features
- New API restriction scope:
RestrictTo.Scope.LIBRARY_GROUP_PREFIX. It restricts usage to code within packages whose groups share the same library group prefix up to the last.(period). For example, because librariesfoo.bar:lib1andfoo.baz:lib2share the prefixfoo, they can use each other's APIs that are restricted to this scope. Similarly, forcom.foo.bar:lib1andcom.foo.baz:lib2share thecom.foo.prefix and can share APIs restricted to that scope. Librarycom.bar.qux:lib3however will not be able to use the restricted API because it only shares the prefixcom.and not all the way until the last.(period).
Version 1.1.0-alpha01
January 30, 2019
androidx.annotation:annotation 1.1.0-alpha01 is released.
New features
- Added a
@ContentViewannotation that allows you to indicate which layout XML file should be inflated. This is supported inComponentActivityin its1.0.0-alpha04andFragmentin its1.1.0-alpha04release as an alternative to usingsetContentView()or overridingonCreateView(), respectively. (aosp/837619)
Version 1.0.2
Version 1.0.2
February 25, 2019
androidx.annotation:annotation 1.0.2 is released.
Bug fixes
- Correct the R8/ProGuard rules which are embedded in the jar. These were incorrectly referencing the old
android.support.annotationtypes instead ofandroidx.annotation. Note: This would have only had an impact on your builds if you were not usinggetDefaultProguardFileas those default rules also included correct rules for both packages. (aosp/891685) - Add a R8/ProGuard rule which explicitly keeps the @Keep annotation itself. This ensures that ProGuard does not remove the annotation from types prior to actually honoring its semantics. Note: This would have only had an impact on your builds if you were not using
getDefaultProguardFileas those default rules also included correct rules for both packages. (aosp/903818)