我試圖打包應用程序,使用阿卡Proguard的,但是我收到一個衆所周知的錯誤消息:收縮阿卡與使用Maven
[INFO] trouble writing output: Too many method references: 80536; max is 65536.
[INFO] You may try using --multi-dex option.
我發現了一個proguard的配置應該收縮阿卡庫: https://bitbucket.org/mackler/safe-metronome/src/16f880347863f560d025016ece19d586fbb9874d/project/proguard.cfg?at=default
我設置了我的Maven構建以使用類似的配置,但似乎並沒有縮小這個Akka庫。據我所知,將prouard應用於項目依賴關係,有必要製作一個具有所有依賴關係的jar文件,並且將它加入到jar中去proguard。
這裏是我的Maven的配置:
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.10</artifactId>
<version>2.4-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.7.0</version>
<extensions>true</extensions>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.6</version>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>4.9</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
<obfuscate>false</obfuscate>
<options>
<option>@proguard.cfg</option>
</options>
</configuration>
</plugin>
</plugins>
</build>
我在做什麼錯?
P.S. dex工具建議使用'--multi-dex'選項,但是我沒有找到如何使用Maven android插件添加它。有什麼解決方法嗎?