安装失败 - 无效的apk文件 - android_opencv_library

时间:2011-07-20 09:53:01

标签: android opencv

我在eclipse中有一个项目(android_opencv_library),其标志为“isLibrary”。在另一个项目“HelloDepp”中,我将此项目作为库引用。没有错误。

  • 运行HelloDepp而不引用此库可以正常工作。
  • 运行HelloDepp WITH引用此库无效。

为什么呢?问题是什么?控制台说:

[2011-07-20 10:53:08 - HelloDepp] ------------------------------  
[2011-07-20 10:53:08 - HelloDepp] Android Launch!  
[2011-07-20 10:53:08 - HelloDepp] adb is running normally.  
[2011-07-20 10:53:08 - HelloDepp] Performing ba.hello.world.HelloDeppActivity activity launch  
[2011-07-20 10:53:10 - HelloDepp] Uploading HelloDepp.apk onto device 'emulator-5554'  
[2011-07-20 10:53:14 - HelloDepp] Installing HelloDepp.apk...  
[2011-07-20 10:53:22 - HelloDepp] Installation failed due to invalid APK file!  
[2011-07-20 10:53:22 - HelloDepp] Please check logcat output for more details.  
[2011-07-20 10:53:22 - HelloDepp] Launch canceled!  

Logcat说:

07-20 10:53:14.030: DEBUG/AndroidRuntime(354): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-20 10:53:14.030: DEBUG/AndroidRuntime(354): CheckJNI is ON
07-20 10:53:14.460: DEBUG/AndroidRuntime(354): --- registering native functions ---
07-20 10:53:16.311: DEBUG/dalvikvm(161): GC_EXPLICIT freed 219 objects / 14608 bytes in 216ms
07-20 10:53:17.361: DEBUG/PackageParser(66): Scanning package: /data/app/vmdl13853.tmp
07-20 10:53:19.640: INFO/PackageManager(66): Removing non-system package:ba.hello.world
07-20 10:53:19.640: INFO/ActivityManager(66): Force stopping package ba.hello.world uid=10037
07-20 10:53:19.940: DEBUG/PackageManager(66): Scanning package ba.hello.world
07-20 10:53:19.950: INFO/PackageManager(66): Package ba.hello.world codePath changed from /data/app/ba.hello.world-1.apk to /data/app/ba.hello.world-2.apk; Retaining data and using new
07-20 10:53:19.960: INFO/PackageManager(66): /data/app/ba.hello.world-2.apk changed; unpacking
07-20 10:53:20.000: WARN/PackageManager(66): Native ABI mismatch from package file
07-20 10:53:20.000: WARN/PackageManager(66): Package couldn't be installed in /data/app/ba.hello.world-2.apk
07-20 10:53:20.020: DEBUG/PackageParser(66): Scanning package: /data/app/ba.hello.world-1.apk
07-20 10:53:20.040: DEBUG/PackageManager(66): Scanning package ba.hello.world
07-20 10:53:20.070: INFO/ActivityManager(66): Force stopping package ba.hello.world uid=10037
07-20 10:53:20.070: DEBUG/PackageManager(66):   Activities: ba.hello.world.HelloDeppActivity
07-20 10:53:20.090: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts
07-20 10:53:20.100: WARN/PackageManager(66): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
07-20 10:53:20.120: WARN/PackageManager(66): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x1be45)
07-20 10:53:20.130: WARN/PackageManager(66): Unknown permission com.google.android.gm.permission.WRITE_GMAIL in package com.android.settings
07-20 10:53:20.130: WARN/PackageManager(66): Unknown permission com.google.android.gm.permission.READ_GMAIL in package com.android.settings
07-20 10:53:20.151: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings
07-20 10:53:20.160: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts
07-20 10:53:20.160: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts
07-20 10:53:20.181: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development
07-20 10:53:20.181: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development
07-20 10:53:20.191: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development
07-20 10:53:20.211: WARN/PackageManager(66): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development
07-20 10:53:20.520: INFO/PackageManager(66): Successfully restored package : ba.hello.world after failed upgrade
07-20 10:53:20.880: DEBUG/dalvikvm(66): GC_EXPLICIT freed 14561 objects / 755024 bytes in 251ms
07-20 10:53:21.090: DEBUG/AndroidRuntime(354): Shutting down VM
07-20 10:53:21.100: DEBUG/dalvikvm(354): Debugger has detached; object registry had 1 entries
07-20 10:53:21.151: INFO/AndroidRuntime(354): NOTE: attach of thread 'Binder Thread #3' failed
07-20 10:57:55.073: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:02:55.080: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:07:55.084: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:12:55.091: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:17:55.094: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:22:55.100: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:27:55.101: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:32:55.111: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:37:55.120: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:42:55.122: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:47:55.131: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol
07-20 11:52:55.133: DEBUG/SntpClient(66): request time failed: java.net.SocketException: Address family not supported by protocol

那是“详细”的Logcat输出。没有错误输出。
任何清单和default.properties中的目标版本= 8 任何“无效的apk文件”错误来自哪些想法? Thx提前。

€dit:这个问题的解决方案实际上就是targetversion。我只试过版本7和8(这将是Android 2.1和2.2)。使用10(=> 2.3)“无效的apk文件”-error消失了。

2 个答案:

答案 0 :(得分:3)

我认为它的版本问题。首先,您要检查您的手机版本是否等于apk版本或更高版本

答案 1 :(得分:2)

将您要安装的apk文件复制到android-sdk / platform-tools

然后使用命令

cd android-sdk / platform-tools

adb install opencv-manager-x86.apk

这适用于您要安装的任何文件