Eclipse和“由于APK文件无效导致安装失败”

时间:2015-08-02 06:58:27

标签: android eclipse

我正在将OpenCVtess-two结合起来制作Android OCR应用程序。它与OpenCV4Android +自定义JNI OpenCV库完美配合,直到我开始导入tess-two库。它编译但不安装:

[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Installation failed due to invalid APK file!

[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Please check logcat output for more details.

[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Launch canceled!

其他帖子表明它是库和参考错误。实际上,当我移除..\tess-two中的Properties->Android->Library时,它可以再次安装。此外,tess-two库已正确编译,因为我已经成功编译了一个示例项目。

这是logcat。

08-02 14:46:07.775: D/AndroidRuntime(14699): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-02 14:46:07.775: D/AndroidRuntime(14699): CheckJNI is OFF
08-02 14:46:07.785: D/dalvikvm(14699): Trying to load lib libjavacore.so 0x0
08-02 14:46:07.795: D/dalvikvm(14699): Added shared lib libjavacore.so 0x0
08-02 14:46:07.805: D/dalvikvm(14699): Trying to load lib libnativehelper.so 0x0
08-02 14:46:07.805: D/dalvikvm(14699): Added shared lib libnativehelper.so 0x0
08-02 14:46:07.835: E/cutils-trace(14699): Error opening trace file: No such file or directory (2)
08-02 14:46:08.005: D/AndroidRuntime(14699): Calling main entry com.android.commands.pm.Pm
08-02 14:46:08.015: D/zipro(9906): Zip: EOCD not found, /data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk is not zip
08-02 14:46:08.015: D/asset(9906): failed to open Zip archive '/data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk'
08-02 14:46:08.015: W/PackageParser(9906): Unable to read AndroidManifest.xml of /data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk
08-02 14:46:08.015: W/PackageParser(9906): java.io.FileNotFoundException: AndroidManifest.xml
08-02 14:46:08.015: W/PackageParser(9906):  at android.content.res.AssetManager.openXmlAssetNative(Native Method)
08-02 14:46:08.015: W/PackageParser(9906):  at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:522)
08-02 14:46:08.015: W/PackageParser(9906):  at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:478)
08-02 14:46:08.015: W/PackageParser(9906):  at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:787)
08-02 14:46:08.015: W/PackageParser(9906):  at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:174)
08-02 14:46:08.015: W/PackageParser(9906):  at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:110)
08-02 14:46:08.015: W/PackageParser(9906):  at android.os.Binder.execTransact(Binder.java:388)
08-02 14:46:08.015: W/PackageParser(9906):  at dalvik.system.NativeStart.run(Native Method)
08-02 14:46:08.015: W/DefContainer(9906): Failed to parse package
08-02 14:46:08.025: W/ActivityManager(455): No content provider found for permission revoke: file:///data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk

1 个答案:

答案 0 :(得分:0)

我添加了

    <uses-sdk android:minSdkVersion="11"
              android:targetSdkVersion="15"/>

到项目和AndroidManifest.xml库中的tess-two。一切正常。