Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12788

Crash on android when saving contact

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.1-dev
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Cordova : 6.1.1 via meteor
      Android : 5.0.1 on Samsung S4 GT-I9506

      Description

      Hi,
      first i'm not sure about version, i use the one in npm and github : 2.3.1 but it doesn't reflect version in issue tracker.
      Step to reproduce :

      var contact = navigator.contacts.create(

      { id: "12345", displayName: "John Doe", emails: [new ContactField('work', "john@doe.com", true)] }

      );

      contact.save(); crash with this stack trace :

      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: rawId is string called 'null'
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get name
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get phone numbers
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: id is string called 'null'
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get addresses
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get organizations
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get emails
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: note is string called 'null'
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: nickname is string called 'null'
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get websites
      05-11 15:18:58.643 24995-4607/fr.univlorraine.mobile.multi E/ContactsAccessor: Could not get birthday from JSON object
      org.json.JSONException: Value null at birthday of type org.json.JSONObject$1 cannot be converted to long
      at org.json.JSON.typeMismatch(JSON.java:100)
      at org.json.JSONObject.getLong(JSONObject.java:517)
      at org.apache.cordova.contacts.ContactAccessorSdk5.getBirthday(ContactAccessorSdk5.java:1959)
      at org.apache.cordova.contacts.ContactAccessorSdk5.modifyContact(ContactAccessorSdk5.java:1471)
      at org.apache.cordova.contacts.ContactAccessorSdk5.save(ContactAccessorSdk5.java:1071)
      at org.apache.cordova.contacts.ContactManager$2.run(ContactManager.java:186)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      at java.lang.Thread.run(Thread.java:818)
      05-11 15:18:58.653 24995-4607/fr.univlorraine.mobile.multi D/ContactsAccessor: Could not get photos
      05-11 15:18:58.713 24995-4607/fr.univlorraine.mobile.multi E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-3
      Process: fr.univlorraine.mobile.multi, PID: 24995
      java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
      at android.os.Parcel.readException(Parcel.java:1546)
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
      at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:160)
      at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:519)
      at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:377)
      at android.content.ContentResolver.applyBatch(ContentResolver.java:1254)
      at org.apache.cordova.contacts.ContactAccessorSdk5.modifyContact(ContactAccessorSdk5.java:1534)
      at org.apache.cordova.contacts.ContactAccessorSdk5.save(ContactAccessorSdk5.java:1071)
      at org.apache.cordova.contacts.ContactManager$2.run(ContactManager.java:186)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      at java.lang.Thread.run(Thread.java:818)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              eskan Cyrille Colin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: