(Android Studio)XML自动完成功能不适用于包含模块

时间:2016-05-03 04:06:36

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

我的项目设置如下

File words = new File(path);
Scanner s = new Scanner(words,"utf-8");

这是build.gradle

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
  - ...

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

时会发生这种情况

enter image description here

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

enter image description here

我已经尝试了一些事情

  1. 包含SharedLibrary作为ModuleA的依赖关系
  2. // build.gradle of CoreModule dependencies { compile project(':SharedLibrary') } // build.gradle of ModuleA dependencies { compile project(':CoreModule') }

    1. 关闭省电模式
    2. 使缓存无效并重新启动
    3. 删除所有iml文件>删除/.idea中的所有内容>重启Android Studio>重建
    4. 但他们都没有解决这个问题,有什么建议吗?

1 个答案:

答案 0 :(得分:4)

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

我的 compileSdkVersion support-v4库不匹配,它们分别为23和21

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

相关问题