我的 Android Studio 声称已弃用像这样在 list 中声明包:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="this.is.my.package">
错误信息是:Move package from Android manifest to build files
Declaration of a project's namespace using the package attribute of the Android manifest is deprecated in favour of a namespace declaration in build files.
但是“运行选定的步骤”按钮被禁用,我无法单击它。
如何修复此错误消息?
最佳答案
将这一行保留在那里,但还要声明 applicationId
和 namespace
在您的 gradle 文件中(例如,具有相同的值 "this.is.my.package"
)。 HERE 中的一些文档,下面的一些示例:
android {
namespace "this.is.my.package"
defaultConfig {
applicationId "this.is.my.package"
... rest of code
关于android - 将包从 Android list 移动到构建文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72226350/