2016-01-05 59 views
0

在android studio上创建模块时出现问题。我最近下载并更新了它。无法在Android Studio 1.5.1中创建模块依赖关系

问题是当我为我的项目创建一个新模块时,它不会将 编译为一个模块。

试图手动添加它在settings.gradle,仍然无法正常工作,我无法弄清楚。

enter image description here

该图像代表模块I创建通常要File > New > New Module

模块gradle这个

apply plugin: 'com.android.library' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     minSdkVersion 14 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    } 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     testCompile 'junit:junit:4.12' 
     compile 'com.android.support:appcompat-v7:23.1.1' 
     compile 'com.squareup.okhttp:okhttp:2.3.0' 
     compile 'com.squareup.retrofit:retrofit:2.0.0-beta2' 
     compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2' 
    } 

settings.gradle

include ':app', ':rest'

问题是,这是一个错误?我怎样才能找出这个问题?

注意:在Android Studio 1.5版本之前,它正在工作。

编辑

./gradle projects结果

------------------------------------------------------------ 
Root project 
------------------------------------------------------------ 

Root project 'ProjectMaster-NoDatabase' 
+--- Project ':app' 
\--- Project ':rest' 

To see a list of the tasks of a project, run gradlew <project-path>:tasks 
For example, try running gradlew :app:tasks 

BUILD SUCCESSFUL 

Total time: 55.561 secs 
+0

请发帖./gradlew projects结果 –

+0

@MenTaka我加了日志 – diogojme

+0

你有'build.gradle'文件在休息吗? – nexus5x

回答

0

为了解决这个问题,我这样做:

1 - 从项目结构删除.idea文件夹。

2 - 然后重新打开该项目。

该项目将打开文件夹作为模块。