Failing on android

Issue #325 wontfix
Former user created an issue

SnakeYAML version: 1.16 Java: Running on Android 5.0.1

Failing at

Constructor construct = new Constructor(Message.class);
Yaml yml = new Yaml(construct);

The initalization is failing with below error.

java.lang.VerifyError: org/yaml/snakeyaml/representer/Representer$RepresentJavaBean
  at org.yaml.snakeyaml.representer.Representer.<init>(Representer.java:43)
  at org.yaml.snakeyaml.Yaml.<init>(Yaml.java:95)
  at in.dreamlabs.wallet.service.MessageParser.parseMessage(MessageParser.java:53)
  at in.dreamlabs.wallet.service.MessageParser.submit(MessageParser.java:132)
  at in.dreamlabs.wallet.view.MainActivity.importSMS(MainActivity.java:103)
  at in.dreamlabs.wallet.view.MainActivity.onCreate(MainActivity.java:60)
  at android.app.Activity.performCreate(Activity.java:5231)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
  at android.app.ActivityThread.access$800(ActivityThread.java:135)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:136)
  at android.app.ActivityThread.main(ActivityThread.java:5001)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  at dalvik.system.NativeStart.main(Native Method)

Comments (8)

  1. Graeme Duncan

    I have encountered the same crash using version 1.16 running on Android 4.4.2, although it worked correctly on a device running 5.0. Recompiling from the 1.16 tag using the android profile made no difference.

    However, I checked out the 1.15 tag and compiled that (using the android profile) and that worked on both Android 4.4.2 and 5.0.

  2. Alexander Maslov

    I am not really sure what's going on. I guess Message.class is the android.os.Messag, am I right?

    I have tried simple dump/load of the empty new Message() with version 16 and 17-SNAPSHOT built with -Pandroid. It worked find (at least without exceptions) in Emulator with API_19_4_4 and API_22_5_0 and on real OnePlus 2 running OxigenOS 2.2.0 which is 5.1.1

    I thing we need to figure out why it is java.lang.VerifyError

    JavaDoc for VeifyError.class says :

    Thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.

    In mine experience it could be anything :) Unfortunately not so much of android development I know.

    Could it be connected to something like Android java.lang.VerifyError ?

  3. Alexander Maslov

    As you can see from that jar you pointed out - it's MANIFEST.INF is empty, so is the one in snakeyaml-...-adroind.jar which you can build yourself. So check your App project where you use SnakeYAML-android jar and see what could be wrong there, because at the moment I do not see SnakeYAML as the main reason of this problem.

  4. Log in to comment