我正在尝试通过maven android插件构建一个Android应用程序。我在pom文件中使用了multi-dex = true。我已经尝试过使用forcejumbo = true。 还搜索了它。没有找到满意的答案。 我在安装apk文件时遇到错误。
当我从cmd安装它时会出错:
失败[INSTALL_FAILED_DEXOPT]
当我尝试从设备上的电子邮件安装它时,它会出错:
E / dex2oat(11177):无法从zip文件的文件描述符中打开dex '/data/app/com.xx.yyy-1/base.apk':无法打开dex文件 来自记忆的'/data/app/com.xx.yyy-1/base.apk':无法识别的魔法 /data/app/com.xx.yyy-1/base.apk中的数字:P K
我该如何解决这个问题?
为什么我使用multi dex:
我收到了这个错误:
编写输出的麻烦:方法引用太多:72545;最大值是65536。 [INFO]您可以尝试使用--multi-dex选项。 所以使用了multi dex
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>22_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>22.2.0</version>
</dependency>
<dependency>
<groupId>com.nostra13.universalimageloader</groupId>
<artifactId>universal-image-loader</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.6.0-beta</version>
<exclusions>
<exclusion>
<artifactId>xpp3</artifactId>
<groupId>xpp3</groupId>
</exclusion>
<exclusion>
<artifactId>android</artifactId>
<groupId>com.google.android</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r09</version>
<exclusions>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.6.0-beta</version>
<exclusions>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.6.0-beta</version>
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
</exclusion>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>android</groupId>
<artifactId>android</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.1</version>
<exclusions>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-analytics</artifactId>
<version>v3-rev96-1.18.0-rc</version>
</dependency>
<dependency>
<groupId>com.facebook.android</groupId>
<artifactId>facebook-android-sdk</artifactId>
<scope>system</scope>
<version>4.0.1</version>
<systemPath>/home/mangospring/ms/mangoandroid/tags/2015_05_18_OC_V_1_4_5/libs/facebooksdk.jar</systemPath>
<exclusions>
<exclusion>
<artifactId>support-v4</artifactId>
<groupId>com.google.android</groupId>
</exclusion>
</exclusions>
</dependency>
<!--dependency>
<groupId>fr.avianey</groupId>
<artifactId>facebook-android-api</artifactId>
<version>3.18.0</version>
<type>aar</type>
</dependency-->
<dependency>
<groupId>com.parse.bolts</groupId>
<artifactId>bolts-android</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>google-play-services</artifactId>
<version>25.0.0</version>
<type>jar</type>
</dependency>
</dependencies>