android studio 重复包,[android-studio-2.2]重复的包名称([android-studio-2.2]Duplicate package name)...

[android-studio-2.2]重复的包名称([android-studio-2.2]Duplicate package name)

但在A类中,该包是“com.example.roxas.myapplication.a”

更新:AndroidStudio 2.2.1发布!升级后问题已经消失!

But In Class A,the package is "com.example.roxas.myapplication.a"

UPDATE:AndroidStudio 2.2.1 is released!After the upgrade the problem has gone !

原文:https://stackoverflow.com/questions/39928388

更新时间:2020-02-07 07:30

最满意答案

我使用Databinding时遇到的问题。 如果我删除build.gradle中的Databinding配置,则问题已修复。

The problem I met when I use Databinding. If I remove the Databinding config in build.gradle,the problem fixed.

2016-10-09

相关问答

我的问题是我正在查看错误的build.gradle文件,但没有看到应用程序ID值。 一旦我找到了正确的文件(感谢@ianhanniballake),我改变了应用程序ID并且它工作正常。 My problem was that I was looking at the wrong build.gradle file and didn't see the application id value. Once I found the correct file (thanks to @ianhanniba

...

你可以这样做: 在清单文件中手动更改包名称。 点击你的R.java类,按F6 ( Refactor-> Move ... )。 它将允许您将类移动到另一个包,并且对该类的所有引用将被更新。 You can do this: Change the package name manually in the manifest file. Click on your R.java class and the press F6 (Refactor->Move...). It will allow you t

...

这两个包用于Android测试。 如果您不进行自动化测试,则可以删除它们。 Those two packages are used for android tests. If you don't do automated tests you can delete those.

这是Android Studio 1.3中的已知错误,应该在下次更新时修复。 This is a known bug in Android Studio 1.3, and it is supposed to be fixed in the next update.

首先,当您更改名称时,请使用Android studio中的重构选项(右键单击包并单击重命名)。 那么你仍然会看到旧包的原因是Android Studio没有检测到任何代码更改,只是给你已经构建的包。 您可以通过project clean来更改此设置。 如果您有任何问题,请发表评论 First of all, when you change the name do it using the refactoring option in Android studio (right click on t

...

我使用Databinding时遇到的问题。 如果我删除build.gradle中的Databinding配置,则问题已修复。 The problem I met when I use Databinding. If I remove the Databinding config in build.gradle,the problem fixed.

对于单元测试(JVM测试),根源代码目录应该是test ,而不是androidTest test androidTest 。 在“Build Variants”下,我选择了“Android Instrument Tests”。 当我将其更改为“单元测试”时,Android Studio正确识别了我的文件。 For unit tests (JVM tests) the root source directory should be test, not androidTest as for Andro

...

模块是项目内源代码的容器。 一个项目可以有多个模块,但每个模块都是一组独立的代码和资源。 例如,当您使用默认设置创建新项目时,Android Studio会生成一个名为app的模块。 该模块包含您的应用程序的所有源代码,资源文件和应用程序级设置。 但是,如果您使用手机/平板电脑应用程序以及Android Wear应用程序创建新项目,您将看到两个模块; mobile和wear 。 这些模块中的每一个都包含其各自应用程序的源代码,资源文件和应用程序级别设置。 您还可以创建另一个模块以在多个模块之间共享

...

Android Gradle插件已将“包名称”与应用程序的唯一标识符分离。 以前,与使用Eclipse和ADT插件的Ant构建系统的情况一样,您的应用程序标识符和“程序包名称”是一样的,由清单中的package属性定义。 使用Gradle构建系统,除了清单中的package属性外,还可以在build.gradle中定义applicationId 。 通常两者是相同的,但并非必须如此。 清单中的package属性决定了R类的Java包。 如果对应用程序的所有版本保持相同,则R类导入不会更改。 应用程

...

打开项目结构视图(在左侧) - >导航到要重命名的包 - >打开上下文菜单,然后选择“重构” - >“重命名”。 Open project structure view (on the left) -> Navigate to the package you want to rename -> Open context menu and choose Refactor -> Rename.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值