正如在 Android Studio 3.0 (canary 3.0) 中看到的,我们现在通过声明 implementation 而不是 compile 配置来添加 depedencies.
As seen in Android Studio 3.0 (canary 3.0), we now add depedencies by declaring implementation instead of compile configuration.
// Before
compile 'com.android.support:appcompat-v7:25.3.1'
// Currently
implementation 'com.android.support:appcompat-v7:25.3.1'
我们仍然可以使用compile,但我想明白:
We can still use compile, but I would like to understand:
implementation和compile配置有什么区别?implementation?implementation and compile configuration?implementation as default?似乎 compile 已被弃用,api 或 implementation 应该改为使用.根据 Java 库插件 - Gradle 用户指南 3.5 版:
It seems like compile has been deprecated and api or implementation should be used instead. According to The Java Library Plugin - Gradle User Guide Version 3.5:
compile 配置仍然存在,但不应使用,因为它无法提供 api 和 implementation 配置提供的保证.
The
compileconfiguration still exists but should not be used as it will not offer the guarantees that theapiandimplementationconfigurations provide.
这篇关于为什么 Android 在 Gradle 依赖项中将“编译"配置更改为“实现"配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Android 上的数字软键盘Numeric Soft Keyboard on Android(Android 上的数字软键盘)
带有软键盘和“返回"的 EditText按钮EditText with soft keyboard and quot;Backquot; button(带有软键盘和“返回的 EditText按钮)
在 Android 上的应用程序中内置自定义“键盘&quoCustom #39;Keyboard#39; built in an application on Android(在 Android 上的应用程序中内置自定义“键盘)
如何在 Android 的移动网站中强制使用带有数字的How to force keyboard with numbers in mobile website in Android(如何在 Android 的移动网站中强制使用带有数字的键盘)
启动 Activity 时自动弹出键盘Automatic popping up keyboard on start Activity(启动 Activity 时自动弹出键盘)
如何制作 Android EditView“完成"按钮并在单击时How do I make an Android EditView #39;Done#39; button and hide the keyboard when clicked?(如何制作 Android EditView“完成按钮并在单击时隐藏