title: Installation failed - invalid apk file - android_opencv_library
body: <p>I have got a project in eclipse (android_opencv_library) which has the flag "isLibrary". In another project "HelloDepp" I reference this project as a library. There are no errors. </p>
  
  <ul>
  <li>Running HelloDepp WITHOUT referencing this library works correctly.</li>
  <li>Running HelloDepp WITH referencing this library doesnt work.</li>
  </ul>
  
  <p>Why? What is the problem? Console says:</p>
  
  <pre><code>[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!  
  </code></pre>
  
  <p>And Logcat says:</p>
  
  <pre><code>07-20 10:53:14.030: DEBUG/AndroidRuntime(354): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  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
  </code></pre>
  
  <p>That was the "Verbose" Logcat ouput. No error output.<br>
  Target Version = 8 in any of the manifests and default.properties.<br>
  Any ideas where the "invalid apk file" error comes from?  Thx in advance.  </p>
  
  <p>€dit: The solution for this problem was in fact the targetversion. I only tried version 7 and 8 (this would be android 2.1 and 2.2). With 10 (=> 2.3) the "invalid apk file"-error vanished.</p>