だけで構成される小さなテスト アプリを生成しましたonCreate()
。エミュレートされたNexus 7に問題なくインストールできadb install
ます。ただし、それを使用してデコードし、(署名をコピーするには -c) を使用apktool decode
して再構築apktool build -c
すると、インストールできない apk が生成されます。
➜ ApkToolTesting adb install justoncreate/dist/justoncreate.apk
1227 KB/s (1145010 bytes in 0.910s)
pkg: /data/local/tmp/justoncreate.apk
Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
この失敗の理由は何でしょうか? 組み立ての過程で何か他のものを失ったに違いありません。
編集:おそらく関連するlogcat
出力:
03-09 17:12:49.129 1946 1958 D DefContainer: Copying /data/local/tmp/justoncreate.apk to base.apk
03-09 17:12:49.167 1302 1326 W PackageManager: Failed collect during installPackageLI
03-09 17:12:49.167 1302 1326 W PackageManager: android.content.pm.PackageParser$PackageParserException: Failed reading res/color/abc_primary_text_material_light.xml in java.util.jar.StrictJarFile@a55736e
03-09 17:12:49.167 1302 1326 W PackageManager: at android.content.pm.PackageParser.loadCertificates(PackageParser.java:600)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1102)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1057)
03-09 17:12:49.167 1302 1326 W PackageManager: at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:12196)
03-09 17:12:49.167 1302 1326 W PackageManager: at com.android.server.pm.PackageManagerService.-wrap25(PackageManagerService.java)
03-09 17:12:49.167 1302 1326 W PackageManager: at com.android.server.pm.PackageManagerService$9.run(PackageManagerService.java:10156)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.os.Handler.handleCallback(Handler.java:739)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.os.Handler.dispatchMessage(Handler.java:95)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.os.Looper.loop(Looper.java:148)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.os.HandlerThread.run(HandlerThread.java:61)
03-09 17:12:49.167 1302 1326 W PackageManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)
03-09 17:12:49.167 1302 1326 W PackageManager: Caused by: java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for res/color/abc_primary_text_material_light.xml in res/color/abc_primary_text_material_light.xml
03-09 17:12:49.167 1302 1326 W PackageManager: at java.util.jar.JarVerifier.invalidDigest(JarVerifier.java:140)
03-09 17:12:49.167 1302 1326 W PackageManager: at java.util.jar.JarVerifier.-wrap0(JarVerifier.java)
03-09 17:12:49.167 1302 1326 W PackageManager: at java.util.jar.JarVerifier$VerifierEntry.verify(JarVerifier.java:132)
03-09 17:12:49.167 1302 1326 W PackageManager: at java.util.jar.JarFile$JarFileInputStream.read(JarFile.java:117)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.content.pm.PackageParser.readFullyIgnoringContents(PackageParser.java:5113)
03-09 17:12:49.167 1302 1326 W PackageManager: at android.content.pm.PackageParser.loadCertificates(PackageParser.java:597)
03-09 17:12:49.167 1302 1326 W PackageManager: ... 10 more