Android - Google+ sharing status crashes and Google Play services crashes

In my application, I submit stuff to Google plus, but after the latest library updates. When I click to publish to Google Plus from my application, Google Play services crash with the following error:

Process: com.google.android.gms.ui, PID: 19643
java.lang.IllegalArgumentException
        at com.google.k.a.aj.a(SourceFile:72)
        at com.google.android.gms.plus.audience.a.e.<init>(SourceFile:63)
        at com.google.android.gms.plus.audience.a.e.<init>(SourceFile:53)
        at com.google.android.gms.plus.audience.a.d.<init>(SourceFile:28)
        at com.google.android.gms.plus.sharebox.al.a(SourceFile:213)
        at android.support.v4.app.ax.c(SourceFile:490)
        at android.support.v4.app.ax.d(SourceFile:499)
        at android.support.v4.app.ax.b(SourceFile:646)
        at com.google.android.gms.plus.sharebox.al.a(SourceFile:192)
        at com.google.android.gms.plus.sharebox.ShareBoxActivity.a(SourceFile:525)
        at com.google.android.gms.plus.sharebox.au.a(SourceFile:810)
        at com.google.android.gms.plus.internal.ce.a(SourceFile:214)
        at com.google.android.gms.common.internal.v.d(SourceFile:200)
        at com.google.android.gms.common.internal.u.handleMessage(SourceFile:136)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5221)
        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:899)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Below is my code that I use for publishing:

 Intent shareIntent = new PlusShare.Builder(getActivity())
        .setType("text/plain")
        .setText(text)
        .setContentUrl(Uri.parse(link))
        .getIntent();

fragment.startActivityForResult(shareIntent, 0);

after the link to this link - Android - Google+ sharing status is completed . I tried to use the 'ShareCompat.IntentBuilder approach , but it does not allow adding a link programmatically, and therefore we must add the link to the text that is laid out using ' setText () . And therefore, the hyperlink looks like plain text.

, - , , , . .

+4
1

, - . . .

-1

Source: https://habr.com/ru/post/1567979/


All Articles