phuongngacntt / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

"Too many field references: 79345; max is 65536 " result in dex phase failure #459

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Project is very large
2.mvn install

What is the expected output?

build success

What do you see instead?

Too many field references: 79345; max is 65536

What version of maven-android-plugin are you using?

3.8.0

What are the complete output lines of "mvn -version" on your machine?

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 
2014-02-15T01:37:52+08:00)
Maven home: D:\Users\wlzhao\Downloads\apache-maven-3.2.1\bin\..
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_45\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Please provide any additional information below.

INFO] trouble writing output: Too many field references: 79345; max is 65536.
[INFO] You may try using --multi-dex option.
[INFO] References by package:
[INFO]     12 android.app
[INFO]     15 android.content.pm
[INFO]      1 android.content.res
[INFO]     41 android.graphics
    other info ommited....

configuration in pom.xml:

<configuration>
    <sdk>
    <platform>19</platform>
    </sdk>
    <dex>
           <jvmArguments>
               <jvmArgument>-Xms1024m</jvmArgument>
               <jvmArgument>-Xmx2048m</jvmArgument>
           </jvmArguments>
        </dex>
</configuration>

I think this is an important problem and it is related to dex format 
constraint.Anybody came accross it before? Any help is honored!

Original issue reported on code.google.com by com.aimo...@gmail.com on 25 Apr 2014 at 8:01

GoogleCodeExporter commented 9 years ago
I think there may be 2 reasons of this issue:
1) project is really huge and real amount of field references over 65536
 in this case you should decrease its size or use separate dex files.
2) this is a maven-android-plugin related issue(it had some problems with 
excess fields references in R.java file in previous versions)
 in this case you can check this issue on newer version(3.8.2) of maven-android-plugin

Original comment by olegalex...@gmail.com on 25 Apr 2014 at 11:14

GoogleCodeExporter commented 9 years ago
@olegalex,thank you very much. i tried 3.8.2,it works for me now.

by the way,do you know how to generate multi-dexes use this plugin ? 

Original comment by com.aimo...@gmail.com on 28 Apr 2014 at 5:36

GoogleCodeExporter commented 9 years ago
@com.aimo, your welcome.

about multi-dexes: as I know for now there is no ability to use it in 
android-maven-plugin. But its better to wait for an answer from project members.

P.S: I should warn your that android-maven-plugin 3.8.2 have some issues with 
apklibs (https://code.google.com/p/maven-android-plugin/issues/detail?id=441).

Original comment by olegalex...@gmail.com on 1 May 2014 at 10:42

GoogleCodeExporter commented 9 years ago
We are no longer using the issue tracking system on Google Code. Please refile 
this issue on https://github.com/jayway/maven-android-plugin/issues if you 
still have this problem with the latest release of the Android Maven Plugin

Original comment by mosa...@gmail.com on 19 May 2014 at 4:20