Sunday, April 21, 2013

[android help] Mismatch Dep Signature after Modifications on Android framework


I modified some code in PackageManagerService.java in Android framework(Android 4.2). After a make, and start the emulator, it report the following error:



10-05 08:20:34.213: I/dalvikvm(575): DexOpt: mismatch dep signature for '/system/framework/core.odex'
10-05 08:20:34.213: E/dalvikvm(575): /system/app/PackageInstaller.apk odex has stale dependencies
10-05 08:20:34.213: E/dalvikvm(575): odex source not available -- failing
10-05 08:20:34.223: W/PackageManager(575): StaleDexCacheError when reading apk: /system/app/PackageInstaller.apk
10-05 08:20:34.223: W/PackageManager(575): dalvik.system.StaleDexCacheError: /system/app/PackageInstaller.apk
10-05 08:20:34.223: W/PackageManager(575): at dalvik.system.DexFile.isDexOptNeeded(Native Method)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.performDexOptLI(PackageManagerService.java:3375)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:3960)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:3238)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.scanDirLI(PackageManagerService.java:3017)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.(PackageManagerService.java:1058)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:837)
10-05 08:20:34.223: W/PackageManager(575): at com.android.server.ServerThread.run(SystemServer.java:177)


If I clean and then make the full project again, it works ok. But it will report the same error after another modification. Since making a full build again will last a very long time, I prefer other solution.


I noticed the code in DexPrepare.cpp:



if (memcmp(signature, ptr, kSHA1DigestLen) != 0) {
LOGI("DexOpt: mismatch dep signature for '%s'", cacheFileName);
goto bail;
}


If I remove these lines of code, it will work. I used to work on Android 2.3, and there are still a signature checking in Android 2.3(Gingerbread), but after modifications on Gingerbread's framework, it will never report such errors. Why is that?



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...