Jetpack is a suite of libraries, tools, and guidance to help developers write high-quality apps easier. These components help you follow best practices, free you from writing boilerplate code, and simplify complex tasks, so you can focus on the code you care about.
Jetpack comprises the androidx.*
package libraries, unbundled from the platform APIs. This means that it offers backward compatibility and is updated more frequently than the Android platform, making sure you always have access to the latest and greatest versions of the Jetpack components.
Our official AARs and JARs binaries are distributed through Google Maven.
You can learn more about using it from Android Jetpack landing page.
For contributions via GitHub, see the GitHub Contribution Guide.
Note: The contributions workflow via GitHub is currently experimental - only contributions to the following projects are being accepted at this time:
When contributing to Jetpack, follow the code review etiquette.
We are not currently accepting new modules.
NOTE: You will need to use Linux or Mac OS. Building under Windows is not currently supported.
repo
(Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see the Repo Command Reference)mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
mkdir androidx-main
cd androidx-main
repo
command to initialize the repository.repo init -u https://android.googlesource.com/platform/manifest -b androidx-main --partial-clone --clone-filter=blob:limit=10M
repo sync -j8 -c
You will use this command to sync your checkout in the future - it’s similar to git fetch
To open the project with the specific version of Android Studio recommended for developing:
cd path/to/checkout/frameworks/support/
ANDROIDX_PROJECTS=MAIN ./gradlew studio
and accept the license agreement when prompted. Now you're ready to edit, run, and test!
You can also the following sets of projects: ALL
, MAIN
, COMPOSE
, or FLAN
If you get “Unregistered VCS root detected” click “Add root” to enable git integration for Android Studio.
If you see any warnings (red underlines) run Build > Clean Project
.
You can do most of your work from Android Studio, however you can also build the full AndroidX library from command line:
cd path/to/checkout/frameworks/support/
./gradlew createArchive
You can build maven artifacts locally, and test them directly in your app:
./gradlew createArchive
And put the following at the top of your 'repositories' property in your project build.gradle
file:
maven { url '/path/to/checkout/out/androidx/build/support_repo/' }
NOTE: In order to see your changes in the project, you might need to clean your build (Build > Clean Project
in Android Studio or run ./gradlew clean
).
Our continuous integration system builds all in progress (and potentially unstable) libraries as new changes are merged. You can manually download these AARs and JARs for your experimentation.
Run FooBarTest
Run androidx.foobar
The AndroidX repository has a set of Android applications that exercise AndroidX code. These applications can be useful when you want to debug a real running application, or reproduce a problem interactively, before writing test code.
These applications are named either <libraryname>-integration-tests-testapp
, or support-\*-demos
(e.g. support-v4-demos
or support-leanback-demos
). You can run them by clicking Run > Run ...
and choosing the desired application.
Before uploading your first contribution, you will need setup a password and agree to the contribution agreement:
Generate a HTTPS password:https://android-review.googlesource.com/new-password
Agree to the Google Contributor Licenses Agreement:https://android-review.googlesource.com/settings/new-agreement
cd path/to/checkout/frameworks/support/
repo start my_branch_name .
# make needed modifications...
git commit -a
repo upload --current-branch .
If you see the following prompt, choose always
:
Run hook scripts from https://android.googlesource.com/platform/manifest (yes/always/NO)?
If the upload succeeds, you'll see output like:
remote:
remote: New Changes:
remote: https://android-review.googlesource.com/c/platform/frameworks/support/+/720062 Further README updates
remote:
To edit your change, use git commit --amend
, and re-upload.
AndroidX uses git to store all the binary Gradle dependencies. They are stored in prebuilts/androidx/internal
and prebuilts/androidx/external
directories in your checkout. All the dependencies in these directories are also available from google()
, jcenter()
, or mavenCentral()
. We store copies of these dependencies to have hermetic builds. You can pull in a new dependency using our importMaven tool.
AndroidX和旧版本包对照表: 最下面是使用方法: 旧包 AndroidX android.arch.core:common androidx.arch.core:core-common:2.0.0-rc01 android.arch.core:core androidx.arch.core:core:2.0.0-rc01 android.arch.core:core-testing andr
implementation 'com.google.android.libraries.places:places:2.2.0' 一些依赖关系开始使用 androidx 这就造成了一些问题 aapt errors and others 安卓立德 在新的地方图书馆实施后。我想保持旧的东西与新的地方自动完成api。如何我可以排除它们还是强制不使用 安卓立德 +--- androidx.fragmen
为什么要有Androidx库? 也许是google官方也对这个早期形成的演化产物不满意,于是对这些API的架构进行了一次重新的划分,推出了AndroidX。Androidx 是对 android.support.xxx包和其他Android支持库整理后的产物。与support库一样,每个AndroidX库都与Android系统版本分开提供,并提供跨Android版本的向后兼容性。 对开发者造成什么
突然发现好多安卓项目已经改为了AndroidX,那么自己的项目也该升级一下了。下面是AndroidX的官方文档的概述。 AndroidX概述 AndroidX是Android团队用于在Jetpack中开发,测试,打包,版本和发布库的开源项目 。 AndroidX是对原始Android 支持库的重大改进 。与支持库一样,AndroidX与Android操作系统分开提供,并提供跨Android
来源 支持库映射: 工件映射 | Android 开发者 | Android Developers 类映射: 类映射 | Android 开发者 | Android Developers 库版本: AndroidX 版本 | Android 开发者 | Android Developers 内容 支持库映射: Old build artifact AndroidX buil
Android 系统源码中添加 androidx 依赖 AndroidX 是对 android.support.xxx 包的整理后产物。由于之前的 support 包过于混乱,所以,Google 推出了AndroidX。 Android 版本 28.0.0 (9.0)是支持support库的最后一个版本。 谷歌将不再发布 android.support 库版本。 所有新功能都将在 androidx
问题内容: 我正在尝试迁移到androidx。我在Android Studio中使用了迁移工具。当我执行此操作时,我在运行应用程序时得到以下堆栈跟踪。 例外是正确的。android.support.v4.content.FileProvider在我的应用中不存在。但是androidx.core.content.FileProvider包含在我的应用程序中。最大的问题是为什么它要加载旧版本的File
我有一个非常令人沮丧的错误,我无法解释。我创建了一个Android应用程序,使用Android AppCompat使其与旧版本兼容。这是我的主要活动布局文件:{Androidx}。 这是我的java文件: 这是我的xml文件: 这是我的gradle文件 }gradle文件中的依赖项 } 主要问题是我的应用程序说,不幸的是,应用程序已经停止。以下是“运行”选项卡中的详细信息 D/skia:-缩放位图
这是我的第一个kotlin android项目,所以为愚蠢道歉。用户选择一个餐馆,用户决定为该特定餐馆添加一个思想,用户单击按钮,思想/usermeal被添加到所选餐馆的“餐食”arraylist中 数据类____ ) ----我在中间屏幕上的活动,餐厅是传入的----
在根据https://docs.mapbox.com/android/maps/guides/install/添加所有依赖项后,当我尝试运行应用程序时出现以下错误: 同步错误: 无法解决:Legacy-Support-Core-Utils-1.0.0受影响的模块:app 生成错误: 任务“:app:CompileDebugJavaWithJavac”执行失败。 无法解析配置“:app:DebugC
问题: 在使用库时,我注意到当我导航回上一个片段时,它重新创建了该片段,从而重新注册了我的所有,这再次触发 现在我从这里尝试了解决方案,但不幸的是,它不起作用 我还试图将我的切换到我的活动,但这也不起作用。尝试将移动到和-不起作用 请建议纠正或任何想法,可以做些什么来防止在导航和方向改变后弹出快捷键。 null
Exception:二进制XML文件第30行:二进制XML文件第30行:inflating类Android.support.design.widget.textInputLayout由:Android.view.filflateException:二进制XML文件第30行:inflating类Android.support.design.widget.textInputLayout由:java.l
我刚刚通过Android Studio菜单选项Refactor->Refactor to androidx迁移到androidx 我得到以下错误: Android.View.InflateException:二进制XML文件行#2:二进制XML文件行#2:膨胀类AndroidX.ConstraintLayout.ConstraintLayout时出错 知道吗? 堆栈跟踪: