Google app engine Android Studio GAE项目部署:类文件是Java8,但支持的最大值是Java7
我在安卓工作室有一个谷歌应用引擎项目。在过去,我曾多次成功地将其部署到我的项目中,以实现GAE。但是,某些项目设置已更改,我无法再部署。我得到的信息是:Google app engine Android Studio GAE项目部署:类文件是Java8,但支持的最大值是Java7,google-app-engine,android-studio,Google App Engine,Android Studio,我在安卓工作室有一个谷歌应用引擎项目。在过去,我曾多次成功地将其部署到我的项目中,以实现GAE。但是,某些项目设置已更改,我无法再部署。我得到的信息是: java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: javax/ws/rs/ApplicationPath.class in /Users/rob/AndroidStudioProjects/SpeedyMovingInven
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: javax/ws/rs/ApplicationPath.class in /Users/rob/AndroidStudioProjects/SpeedyMovingInventory/backend/build/exploded-app/WEB-INF/lib/javax.ws.rs-api-2.1-m02.jar
Unable to update app: Class file is Java 8 but max supported is Java 7: javax/ws/rs/ApplicationPath.class in /Users/rob/AndroidStudioProjects/SpeedyMovingInventory/backend/build/exploded-app/WEB-INF/lib/javax.ws.rs-api-2.1-m02.jar
Please see the logs [/var/folders/cn/3ktx4pj50hs7338v88b0sckh0000gn/T/appcfg3087406806803083082.log] for further information.
我已尝试在我的build.gradle中设置源和目标兼容性,如下所示:
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.34'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.34'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.34'
compile 'joda-time:joda-time:2.8.2'
compile 'net.sargue:mailgun:1.0.0'
compile 'com.google.code.gson:gson:2.7'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
// Set this dependency if you want to use Hamcrest matching
testCompile 'org.hamcrest:hamcrest-library:1.1'
testCompile fileTree(include: ['*.jar'], dir: '/Users/rob/appengine-java-sdk-1.9.34/lib/impl')
testCompile fileTree(include: ['*.jar'], dir: '/Users/rob/appengine-java-sdk-1.9.34/lib/testing')
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
}
我还使用androidstudio生成了一个示例GAE模块,并成功地将该示例部署到GAE。我比较了gradle文件和设置,没有发现任何差异。请帮忙,我做错了什么?经过大量研究,我找到了解决办法。库'net.sargue:mailgun:1.0.0'显然在某种程度上依赖于Java8库(或者类似的库)。我不知道为什么这在过去没有给我带来麻烦,但现在是了。将库升级到“net.sargue:mailgun:1.3.2”解决了这个问题。我与mailgun库的作者进行了一次对话: 他有一个被更新为Java8的依赖项,他在新版本中修复了它