INSTALL_FAILED_MISSING_SHARED_LIBRARY和意外的顶级例外情况

时间:2014-05-30 21:52:18

标签: java android exception compilation android-studio

所以我正在开发一个实现Caldroid库的Android应用程序。起初,当我尝试构建应用程序时,我得到了一个DexException。我通过删除android-support-v4.jar

中的Syncc/app/build/exploded-aar/Syncc/caldroid/unspecified/libs文件来解决此问题

' Syncc'是应用程序的名称和应用程序'是模块。我不太确定这意味着什么(如果有人能说明我非常感激),那就是AndroidStudio的成功方式。

因此,当我尝试构建应用程序时删除该文件后,它可以正常工作,但将其安装到我的设备上并不是。终端说如下:

Waiting for device.
Target device: samsung-gt_n7100-4d005d114bf9604f
Uploading file
    local path: C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\apk\app-debug-unaligned.apk
    remote path: /data/local/tmp/com.nttkjwmp.syncc.app
Installing com.nttkjwmp.syncc.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.nttkjwmp.syncc.app"
pkg: /data/local/tmp/com.nttkjwmp.syncc.app
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

当我把文件放回来时,这是终端输出:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    C:\Users\Nicolas\AppData\Local\Android\android-studio\sdk\build-tools\android-4.4.2\dx.bat --dex --output C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\dex\debug C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\classes\debug C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\dependency-cache\debug C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\pre-dexed\debug\android-support-v4-dcbacb5a563a38baf2818d3992287104d67e74f2.jar C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\pre-dexed\debug\classes-1d8979f21bebf58bb6900d1b0d10af9c29510f44.jar C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\pre-dexed\debug\classes-848439748d02ee11d97f22ad9f7789545209e0f1.jar C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\pre-dexed\debug\date4j-b11e34e16255b8734f64de0013eac10517e12be4.jar C:\Users\Nicolas\AndroidStudioProjects\Syncc\app\build\pre-dexed\debug\support-v4-19.1.0-a9f29dd44ea69fc9776ae436c7b280cb22ffdec4.jar
Error Code:
    2
Output:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
        at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
        at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
        at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
        at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
        at com.android.dx.command.dexer.Main.run(Main.java:230)
        at com.android.dx.command.dexer.Main.main(Main.java:199)
        at com.android.dx.command.Main.main(Main.java:103)

所以有人能指出我在这里失踪的东西吗?我是否必须删除另一个文件或者可能在gradle文件中添加内容?提前谢谢!

1 个答案:

答案 0 :(得分:2)

设备上缺少<uses-library> AndroidManifest.xml中您的应用所需的某些库。 如果是com.google.android.maps,请尝试将其替换为Google Play服务。