【问题标题】:(Android Studio) XML Autocomplete not working in including module(Android Studio) XML 自动完成在包含模块时不起作用
【发布时间】:2016-08-27 23:38:06
【问题描述】:

我有一个项目,其设置如下

Project
- SharedLibrary
  - APTextView
- CoreModule
  - core_module_layout_1.xml
  - core_module_layout_2.xml
  - core_module_layout_3.xml
  - ...
- ModuleA
  - module_a_layout_1.xml
  - module_a_layout_2.xml
  - ...

这是 build.gradle

// build.gradle of CoreModule
dependencies {
    compile project(':SharedLibrary')
}

// build.gradle of ModuleA
dependencies {
    compile project(':CoreModule')
}

此设置已经工作了一年多,直到最近我更新到 Android Studio 2.0 时,XML 自动完成功能不再适用于 ModuleA 中的任何 xml 布局文件 ,这就是我在任何 ModuleA 布局文件中按 ctrl+space 时发生的情况

但是! 在 CoreModule 中的每个布局文件中仍然正常工作,这是我在任何 CoreModule 布局文件中尝试相同的时候

我已经尝试了一些东西

  1. 包含 SharedLibrary 作为 ModuleA 的依赖项

dependencies { compile project(':CoreModule') compile project(':SharedLibrary') }

  1. 关闭省电模式
  2. 使缓存无效并重新启动
  3. 删除所有 iml 文件 > 删除 /.idea 中的所有内容 > 重启 Android Studio > 重建

但他们都没有解决这个问题,有什么建议吗?

【问题讨论】:

    标签: android xml android-studio intellij-idea autocomplete


    【解决方案1】:

    我问这个问题已经几个月了,我终于找到了这个问题的根本原因

    我的 compileSdkVersionsupport-v4 库 不匹配,它们是 23 和 21

    将它们设置为相同版本即可解决问题。

    【讨论】:

      猜你喜欢
      • 2019-11-26
      • 2022-12-30
      • 2017-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-09
      • 1970-01-01
      相关资源
      最近更新 更多