6

While running a a freshly installed app, I find this Warning messages in the logcat:

W/PackageManager( 1233): Couldn't remove dex file for package:  at location /data/app/xx.yy.zz-1/base.apk, retcode=-1
I/SmartHeartBeat( 1233): listenAppUpdate, package: xx.yy.zz has been Updated
W/PackageParser( 2909): Unknown element under <manifest>: meta-data at /storage/emulated/0/xxx/zz.apk Binary XML file line #143

Trying to track down the offending meta-data element tagged Binary XML file line #143, I find the following:

# aapt l -a zz.apk

AndroidManifest.xml
META-INF/CERT.RSA
META-INF/CERT.SF
META-INF/MANIFEST.MF
...
Android manifest:
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=2)
    ...
    A: platformBuildVersionCode=(type 0x10)0x19 (Raw: "25")
    A: platformBuildVersionName="7.1.1" (Raw: "7.1.1")
    ...
    E: meta-data (line=143)
      A: android:name(0x01010003)="android.support.VERSION" (Raw: "android.support.VERSION")
      A: android:value(0x01010024)="25.3.1" (Raw: "25.3.1")
...

But I don't have anything like this in my AndroidManifest.xml and the only other reference to "25.3.1" is in my gradle.build file, which are the dependency lines for the Android Support Libraries:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:25.3.1'
    ...
}

What is the problem and why does this warning occur? (How do I resolve it?)

not2qubit
  • 14,531
  • 8
  • 95
  • 135
  • 1
    Turn off instant run. – azizbekian Apr 07 '17 at 12:35
  • @azizbekian I turned it off **and** downgraded the support library, back to 25.1.0, and the problem seem gone! Any ideas what is causing it? – not2qubit Apr 09 '17 at 14:28
  • So, if you change support libs to `25.3.1` it won't work? – azizbekian Apr 09 '17 at 14:29
  • Actually things are a bit more complicated, since package was rebased and both AS and libraries was updated within 2 days. I need to test it again, since I never used instant run and have no idea if it was off before the update. So how did you find out it may be related to instant run? – not2qubit Apr 09 '17 at 14:39
  • 1
    You see weird outputs that you have never expected to see - first thing you should think of is instant run. – azizbekian Apr 09 '17 at 14:40
  • @azizbekian Please post an answer that I can accept. I re-upped libraries and it still compiles fine. Another FUd source for strange behavior seem to be the `minifyEnabled true` which is out-of-the-box incompatible with ProGuard and also do not work with [various things](https://developer.android.com/studio/build/shrink-code.html#keep-code). – not2qubit Apr 10 '17 at 10:35

1 Answers1

2

Turning off instant run feature would resolve the issue.

Community
  • 1
  • 1
azizbekian
  • 60,783
  • 13
  • 169
  • 249