gpt4 book ai didi

java - Android框架修改后的不匹配Dep签名

转载 作者:行者123 更新时间:2023-11-30 03:44:03 25 4
gpt4 key购买 nike

我在Android框架(Android 4.2)中修改了PackageManagerService.java中的一些代码。 make之后,启动模拟器,报如下错误:

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.<init>(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)

如果我清理然后再次制作完整的项目,它就可以正常工作。但是再修改之后还是会报同样的错误。由于再次进行完整构建会持续很长时间,因此我更喜欢其他解决方案。

我注意到 DexPrepare.cpp 中的代码:

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

如果我删除这些代码行,它将起作用。我以前在Android 2.3上工作,Android 2.3(Gingerbread)中还有签名检查,但是在Gingerbread的框架上修改后,就再也不会报这样的错误了。这是为什么?

最佳答案

我最终通过显式运行 make droidcore 解决了这个问题。

关于java - Android框架修改后的不匹配Dep签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15286071/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com