为什么Android Studio认为我的App Engine模块是Android应用程序?

时间:2016-05-25 15:14:46

标签: google-app-engine android-studio gradle

我有一个包含

的项目
  • Android应用模块
  • App Engine(云端点)模块

当我使用较旧版本的Android Studio创建项目时,它在模块之间创建了一个引用,我将其删除。在我这样做之前,我还尝试将应用程序模块中的最低版本提升到21,但Android Studio或LINT仍然认为我的App Engine模块是一个应用程序并标记代码如

  • list.isEmpty()
  • new AbstractMap.SimpleEntry<>()

类似于Call required API level 9 (current min is 1): (...)

项目编译正常,但错误用红色加下划线并显示在LINT中。

在项目gradle和模块gradle中我都看不到任何可疑的东西。知道问题可能是什么或在哪里搜索和解决这个问题?

为完整起见,这里是gradle文件:

Projct:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

App Engine模块:

// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.30'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.30'
    compile 'com.google.appengine:appengine-endpoints:1.9.30'
    compile 'com.google.appengine:appengine-endpoints-deps:1.9.30'
    compile 'com.google.appengine.tools:appengine-gcs-client:0.5'
    compile 'javax.servlet:servlet-api:2.5'
    compile 'com.googlecode.objectify:objectify:5.1.3'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.retrofit:converter-simplexml:1.9.0'
    compile 'io.jsonwebtoken:jjwt:0.6.0'
    compile 'org.slf4j:slf4j-parent:1.7.10' // required for JJWT
    compile 'org.slf4j:slf4j-nop:1.7.10' // suppress all internal logging in JJWT
}

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
}

应用模块:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "cc.closeup.android.test"
        minSdkVersion 21
        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'])
    compile 'com.android.support:appcompat-v7:23.4.0'
}

0 个答案:

没有答案