I've implemented Google App Invites in my app using this guide : https://developers.google.com/app-invites/android/guides/app
I can send the invite and it is received by the person I invited. The problem is the install button in the email crashes Google Play Services when the app is already installed. It the shows me following error.
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.content.Intent.addFlags(int)' on a null object reference
at com.google.android.gms.appinvite.notification.a.a(SourceFile:219)
at com.google.android.gms.appinvite.a.onPostExecute(SourceFile:29)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Does anybody have a clue to what I'm doing wrong?