我有一个项目在eclipse (android_opencv_library)有标志"isLibrary"。在另一个项目"HelloDepp"中,我引用这个项目作为一个库。没有错误。
- 运行HelloDepp而不引用这个库可以正常工作。
- 运行HelloDepp与引用这个库不工作。
为什么?有什么问题吗?控制台说:
[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输出。无错误输出。
目标版本= 8在任何清单和default.properties.
你知道"无效的apk文件"错误来自哪里吗?提前感谢。
€dit:这个问题的解决方案实际上是目标版本。我只尝试了版本7和8(这将是android 2.1和2.2)。与10(=> 2.3)"无效的apk文件"-错误消失。
我想是版本问题。首先你要检查你的手机版本是否等于apk build版本或更高版本
复制你想要安装的apk文件到android-sdk/platform-tools
然后使用命令
cd android sdk/平台工具
adb install openv -manager-x86.apk
这将适用于任何你想安装的文件