2011-04-16 68 views
3

我試圖使用所提供的樣品,但是當我補充一點,我已經與POJO的創造了另一個罐子,我不能再編譯應用程序的Android應用程序不能包括第三方jar文件與Maven的Android的插件

  <plugin> 
       <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
       <artifactId>maven-android-plugin</artifactId> 
       <version>2.8.4</version> 
       <configuration> 
        <sdk> 
         <platform>9</platform> 
        </sdk> 
        <emulator> 
         <avd>23</avd> 
         <wait>10000</wait> 
         <!--<options>-no-skin</options>--> 
        </emulator> 
        <zipalign> 
         <verbose>true</verbose> 
        </zipalign> 
        <deleteConflictingFiles>true</deleteConflictingFiles> 
        <undeployBeforeDeploy>true</undeployBeforeDeploy> 
       </configuration> 
      </plugin> 

當我用我的罐子我創造,我得到這個錯誤OOM

[INFO] solution is to recompile the class from source, using an up-to-date compiler 
    [INFO] and without specifying any "-target" type options. The consequence of ignoring 
    [INFO] this warning is that reflective operations on this class will incorrectly 
    [INFO] indicate that it is *not* an inner class. 
    [INFO] 
    [INFO] UNEXPECTED TOP-LEVEL ERROR: 
    [INFO] java.lang.OutOfMemoryError: Java heap space 
    [INFO] at com.android.dx.rop.code.RopMethod.calcPredecessors(RopMethod.java:153) 
    [INFO] at com.android.dx.rop.code.RopMethod.labelToPredecessors(RopMethod.java:95) 
    [INFO] at com.android.dx.dex.code.RopTranslator.pickOrder(RopTranslator.java:345) 
    [INFO] at com.android.dx.dex.code.RopTranslator.translateAndGetResult(RopTranslator.java:205) 
    [INFO] at com.android.dx.dex.code.RopTranslator.translate(RopTranslator.java:102) 
    [INFO] at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:289) 
    [INFO] at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131) 
    [INFO] at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85) 
    [INFO] at com.android.dx.command.dexer.Main.processClass(Main.java:369) 
    [INFO] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346) 
    [INFO] at com.android.dx.command.dexer.Main.access$400(Main.java:59) 
    [INFO] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:134) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122) 
    [INFO] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108) 
    [INFO] at com.android.dx.command.dexer.Main.processOne(Main.java:313) 
    [INFO] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233) 
    [INFO] at com.android.dx.command.dexer.Main.run(Main.java:185) 
    [INFO] at com.android.dx.command.dexer.Main.main(Main.java:166) 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Reactor Summary: 
    [INFO] 
    [INFO] Chapter 06: Mobile Device Parent .................. SUCCESS [0.359s] 
    [INFO] Chapter 06: Mobile Device Application ............. FAILURE [1:27.859s] 

我甚至嘗試加大了內存

set JAVA_OPTS="%JAVA_OPTS% -Xmx512m -XX:MaxPermSize=768m" 

但還是跑出出於某種原因。

現在,當我嘗試使用從別人另一個罐子,說佳潔士其中指出它的工作外的開箱即用的機器人:

<dependency> 
     <groupId>org.codegist.crest</groupId> 
     <artifactId>codegist-crest</artifactId> 
    </dependency> 

然後我嘗試建立與此錯誤:

[INFO] trouble processing "javax/xml/bind/annotation/adapters/CollapsedStringAdapter.class": 
    [INFO] 
    [INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*) 
    [INFO] when not building a core library. 
    [INFO] 
    ... 
    [INFO] If you are legitimately using some code that happens to be in a 
    [INFO] core package, then the easiest safe alternative you have is to 
    [INFO] repackage that code. That is, move the classes in question into 
    [INFO] your own package namespace. This means that they will never be in 
    [INFO] conflict with core system classes. JarJar is a tool that may help 
    [INFO] you in this endeavor. If you find that you cannot do this, then 
    [INFO] that is an indication that the path you are on will ultimately 
    [INFO] lead to pain, suffering, grief, and lamentation. 

所以

  1. 我怎麼確定我一下班能夠使用Android applicati使用上?

  2. 如何構建一個公共域罐子是

回答

2

關於OOM: 嘗試設置MAVEN_OPTS = 「 - Xmx512m」 而不是JAVA_OPTS

對於核心類:你得到的信息是相當翔實。罐子已包含包含在覈心命名空間中的一些類,這是不允許的。您可以使用jarjar的建議。

  1. 您可以使用此處列出類:http://developer.android.com/reference/packages.html
  2. 似乎不完整的問題
相關問題