I’m trying to integrate the Accessory SDK into a library, but trying to compile a project using said library throws an error.
After a bit of research, it seems like the Accessory SDK is being compiled against an old version of Java, and isn’t compatible with the new verification scheme found in Java 1.7 and up.
Error here:
Expecting a stackmap frame at branch target 116
Exception Details:
Location:
com/samsung/android/sdk/accessory/RegisterUponInstallReceiver.onReceive(Landroid/content/Context;Landroid/content/Intent;)V @1: ifnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 2cc6 0073 2cb6 0016 c600 6c2c b600 1612
0000010: 05b6 0021 9900 60b2 0012 bb00 1159 1201
0000020: b700 232b b600 15b6 0024 b600 25b8 0017
0000030: 57bb 000f 2bb7 001f a700 144d b200 1212
0000040: 032c b800 22b6 0020 b800 1857 2ab6 0019
0000050: 4dbb 000e 592b b600 14b7 001c 594c b600
0000060: 1d4e bb00 0c59 1202 2d2c b700 1ab6 001b
0000070: 2bb6 001e b1
Exception Handler Table:
bci [49, 56] => handler: 59
java.lang.VerifyError: Expecting a stackmap frame at branch target 116
Exception Details:
Location:
com/samsung/android/sdk/accessory/RegisterUponInstallReceiver.onReceive(Landroid/content/Context;Landroid/content/Intent;)V @1: ifnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 2cc6 0073 2cb6 0016 c600 6c2c b600 1612
0000010: 05b6 0021 9900 60b2 0012 bb00 1159 1201
0000020: b700 232b b600 15b6 0024 b600 25b8 0017
0000030: 57bb 000f 2bb7 001f a700 144d b200 1212
0000040: 032c b800 22b6 0020 b800 1857 2ab6 0019
0000050: 4dbb 000e 592b b600 14b7 001c 594c b600
0000060: 1d4e bb00 0c59 1202 2d2c b700 1ab6 001b
0000070: 2bb6 001e b1
Exception Handler Table:
bci [49, 56] => handler: 59