zoukankan      html  css  js  c++  java
  • 编译android程序时DEX过程出现错误

    今天编译高级设置时出现了错误,这好坑爹啊~

    于是我开始检查代码,发现代码没有错误啊,然后观察MAKE的步骤才发现是DEX时出现了问题!!

    下面是错误的LOG:

    Information:Using javac 1.7.0_25 to compile java sources
    Information:Module "AdvanceSettings" was fully rebuilt due to project configuration/dependencies changes
    Information:Compilation completed with 22 errors and 0 warnings in 17 sec
    Information:22 errors
    Information:0 warnings
    Error:Android Dex: [AdvanceSettings] UNEXPECTED TOP-LEVEL EXCEPTION:
    Error:Android Dex: [AdvanceSettings] java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
    Error:Android Dex: [AdvanceSettings] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.processClass(Main.java:490)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    Error:Android Dex: [AdvanceSettings] at com.android.dx.command.dexer.Main.run(Main.java:209)
    Error:Android Dex: [AdvanceSettings] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Error:Android Dex: [AdvanceSettings] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    Error:Android Dex: [AdvanceSettings] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    Error:Android Dex: [AdvanceSettings] at java.lang.reflect.Method.invoke(Method.java:606)
    Error:Android Dex: [AdvanceSettings] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
    Error:Android Dex: [AdvanceSettings] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:261)
    Error:Android Dex: [AdvanceSettings] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
    Error:Android Dex: [AdvanceSettings] 1 error; aborting

    于是我就去谷歌,得出:因为有重复的包添加了,只要把重复的包从BuildPath中移除就行了..

    我就去看了下BuildPath,发现有两个外部jar,一个是android-support-v13.jar,还有一个是android-support-v4.jar

    然后我把android-support-v4.jar给移除,重新编译!!!欧耶,一次通过~~~

  • 相关阅读:
    生成doc
    Struts2 配置
    Struts(一)struts2.2概述与MVC模式深度剖析
    [DOM Event Learning] Section 4 事件分发和DOM事件流
    jquery 高亮显示案例
    jquery 下拉菜单
    3_1:操作样式
    2_2:筛选器
    2_1:选择元素
    本地存储小案例:记住用户名
  • 原文地址:https://www.cnblogs.com/GentlemanMod/p/3254225.html
Copyright © 2011-2022 走看看