InstagramPlugin: Plugin Crash

Hi! Great plugin.

I have this app that relys evely on this plugin. I get a lot of people complaining that the app crashes after posting a picture (when they get back to my app).

It seems to happen only on Android 5 or latter… And in Moto G’s … screenshot-area-2016-08-31-000003

My code:

Instagram.share(square.toDataURL(), description, function (err) {
    ...
    if (err) {
        console.log(err);
    }
});

I don’t know enought Java to be able to solve this problem but this crash report might help you guys. Let me know if you need more information and thanks!

Crash report:

java.lang.RuntimeException: Unable to resume activity {com.instasquares/com.instasquares.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=12345, result=0, data=null} to activity {com.instasquares/com.instasquares.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3026)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3061)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2415)
    at android.app.ActivityThread.access$800(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1313)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5345)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)
Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=12345, result=0, data=null} to activity {com.instasquares/com.instasquares.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3646)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3012)
    ... 11 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference
    at com.vladstirbu.cordova.CDVInstagramPlugin.onActivityResult(CDVInstagramPlugin.java:135)
    at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:151)
    at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:348)
    at android.app.Activity.dispatchActivityResult(Activity.java:6226)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3642)
    ... 12 more

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 28 (10 by maintainers)

Most upvoted comments

Update: I’m not really sure if this problem has been solve because the last “error spike” is from 30 of November: screenshot-area-2016-12-09-183741

But either way I’ve decided to try to get rid of it by creating a bounty: https://www.bountysource.com/issues/37430564-plugin-crash

Here is the app using the plugin: https://play.google.com/store/apps/details?id=com.instasquares

I’m now using cordova platform add android@6.1.0 and cordova cli 6.4.0

If anyone needs some info please ask and I will provide it…

Thanks to everyone.