试图提高运行在Android工作室工作室、Android

由网友(名字长才拉风)分享简介:我试图安装JDO / JPA在Android的Studio和havefollowed从previous问题here.I'm trying to setup jdo/jpa in Android Studio and havefollowed an answer from a previous question her...

我试图安装JDO / JPA在Android的Studio和havefollowed从previous问题here.

I'm trying to setup jdo/jpa in Android Studio and havefollowed an answer from a previous question here.

当我尝试运行提升的任务,我得到:

When I attempt to run the enhance task I get:

Error:Execution failed for task ':backend:appengineEnhance'.
An error occurred enhancing DataNucleus classes.

和日志文件显示:

java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.NoSuchMethodError: org.datanucleus.plugin.PluginManager.<init>(Lorg/datanucleus/PersistenceConfiguration;Lorg/datanucleus/ClassLoaderResolver;)V
at org.datanucleus.OMFContext.<init>(OMFContext.java:159)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:172)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:150)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)
... 7 more

我觉得这工作得很好,上周我的桌面上,但我试图复制它在我的笔记本电脑并没有什么似乎工作(到位桶克隆库)。这是我的摇篮:

I thought this worked fine last week on my desktop but I'm trying to replicate it on my laptop and nothing appears to be working (cloned bitbucket repository). Here is my gradle:

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

repositories {
    mavenCentral();
}

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

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
  appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.1'
  compile 'com.google.appengine:appengine-endpoints:1.9.1'
  compile 'com.google.appengine:appengine-endpoints-deps:1.9.1'
  compile 'javax.servlet:servlet-api:2.5'

    // Persistence
    compile 'org.ow2.asm:asm:4.0'
    compile 'org.datanucleus:datanucleus-api-jpa:3.1.3'
    compile 'org.datanucleus:datanucleus-api-jdo:3.1.3'
    compile 'com.google.appengine.orm:datanucleus-appengine:2.1.2'
    compile 'org.datanucleus:datanucleus-core:3.1.3'
    compile 'org.apache.geronimo.specs:geronimo-jpa_2.0_spec:1.0'
    compile 'javax.jdo:jdo-api:3.0.1'
    compile 'javax.transaction:jta:1.1'

}

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

推荐答案

每@loosebazooka上面的答案是使用v2的增强剂在上述评论的链接。

Per @loosebazooka above the answer is to use the v2 enhancer at the link in the comments above.

阅读全文

相关推荐

最新文章