1

Update: This problem is fixed in new versions of Samsung's SPen SDK.

I am trying to create a signed APK with Eclipse 3.7.1, running Proguard 4.7 as part of the process. However, I am unable to run Proguard on projects which include Samsung's SPen SDK 1.5 and get the following errors:

[2012-01-16 14:16:45 - SDraw_Example1] Proguard returned with error code 1. See console
[2012-01-16 14:16:45 - SDraw_Example1] java.io.IOException: Can't read [C:\Work\Mobile\EclipseWorkspace\SDraw_Example1\libs\libspen.jar] (Can't process class [com/samsung/sdraw/CanvasView.class] (Unknown verification type [25] in stack map frame))
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.InputReader.readInput(InputReader.java:230)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.InputReader.readInput(InputReader.java:200)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.InputReader.readInput(InputReader.java:178)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.InputReader.execute(InputReader.java:78)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.ProGuard.readInput(ProGuard.java:196)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.ProGuard.execute(ProGuard.java:78)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.ProGuard.main(ProGuard.java:492)
[2012-01-16 14:16:45 - SDraw_Example1] Caused by: java.io.IOException: Can't process class [com/samsung/sdraw/CanvasView.class] (Unknown verification type [25] in stack map frame)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.ClassReader.read(ClassReader.java:112)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.JarReader.read(JarReader.java:65)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.InputReader.readInput(InputReader.java:226)
[2012-01-16 14:16:45 - SDraw_Example1]  ... 6 more
[2012-01-16 14:16:45 - SDraw_Example1] Caused by: java.lang.RuntimeException: Unknown verification type [25] in stack map frame
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.createVerificationType(ProgramClassReader.java:890)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.visitFullFrame(ProgramClassReader.java:659)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.attribute.preverification.FullFrame.accept(FullFrame.java:114)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.visitStackMapTableAttribute(ProgramClassReader.java:452)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.attribute.preverification.StackMapTableAttribute.accept(StackMapTableAttribute.java:71)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.visitCodeAttribute(ProgramClassReader.java:422)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.visitProgramMethod(ProgramClassReader.java:200)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:142)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2012-01-16 14:16:45 - SDraw_Example1]  at proguard.io.ClassReader.read(ClassReader.java:91)
[2012-01-16 14:16:45 - SDraw_Example1]  ... 11 more

Similar problems were reported for Java 7 but my Java compiler compliance level is set to 1.6 and I checked jre6 in "Installed JREs".

You can get the source code to reproduce the problem on Samsung Mobile's website here: http://innovator.samsungmobile.com/down/cnts/toolSDK.detail.view.do?platformId=1&cntsId=10210

I am trying to export the sample project SDraw_Example1 included in the above Zip file.

Any idea about what might be causing the problem and how to fix it? Thanks!

Pooks
  • 2,565
  • 3
  • 37
  • 40

2 Answers2

1

I met the same problem but it disappeared when I changed my output class format to 1.6. it seems spenlib.jar is compiled with class format 1.6 and your compiler is set to 1.5 or vice versa. I have no idea why proguard complain on it but it worked.

Alan Goo
  • 75
  • 1
  • 6
1

The problem is caused by corrupt preverification information (a StackMapTable attribute) attached to a method in the SPen library (libspen.jar). The library appears to have been processed with ProGuard itself, but maybe the preverification was misconfigured, or another tool has subsequently broken the preverification information. You could modify ProGuard to ignore the attribute and even preverify the library again. I will notify Samsung in your thread on their developers' forum.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • 1
    Thanks Eric! I looked at Proguard's documentation but can't figure out how to ignore the StackMapTable attribute in order to preverify the library again. I tried this but i simply get the original error again and Proguard produces no output. `C:\Android\android-sdk\tools\proguard\lib>java -jar proguard.jar -injars libspen.jar -outjars libspen_rePG.jar -dontshrink -dontoptimize -dontobfuscate` – Pooks Jan 17 '12 at 02:59
  • Found this thread http://sourceforge.net/tracker/?func=detail&aid=3427623&group_id=54750&atid=474704 so I guess I need to modify Proguard's source code and rebuild it. I started doing this but am running into various problems. Are there any help resources about re-building Proguard? – Pooks Jan 17 '12 at 08:49
  • I managed to rebuild Proguard and preverified the library again, but the same errors come up with the new library too (although the unknown verification type is now [37] instead of [25]). Since I don't absolutely need it anyway, I guess I will just drop the library until it is fixed ... – Pooks Jan 18 '12 at 02:42