0

I would like to know which is the minimum SDK API level for using Google App Invites in Android. Because I've tested in Marshmallow, and KitKat, and it's working fine. But I'm getting an error in Gingerbread. This is the stack trace:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gms/com.google.android.gms.appinvite.AppInviteActivity}: java.lang.NullPointerException
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
                                                                         at android.app.ActivityThread.access$1500(ActivityThread.java:123)
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                         at android.os.Looper.loop(Looper.java:130)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:3835)
                                                                         at java.lang.reflect.Method.invokeNative(Native Method)
                                                                         at java.lang.reflect.Method.invoke(Method.java:507)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
                                                                         at dalvik.system.NativeStart.main(Native Method)
                                                                      Caused by: java.lang.NullPointerException
                                                                         at com.google.android.gms.appinvite.ui.a.f.<init>(:com.google.android.gms:168)
                                                                         at com.google.android.gms.appinvite.ui.a.r.k(:com.google.android.gms:80)
                                                                         at com.google.android.gms.appinvite.ui.context.h.onCreateView(:com.google.android.gms:443)
                                                                         at android.support.v4.app.Fragment.performCreateView(:com.google.android.gms:1962)
                                                                         at android.support.v4.app.ag.a(:com.google.android.gms:1026)
                                                                         at android.support.v4.app.ag.a(:com.google.android.gms:1207)
                                                                         at android.support.v4.app.j.run(:com.google.android.gms:738)
                                                                         at android.support.v4.app.ag.i(:com.google.android.gms:1572)
                                                                         at android.support.v4.app.ab.c(:com.google.android.gms:330)
                                                                         at android.support.v4.app.w.onStart(:com.google.android.gms:511)
                                                                         at com.google.android.gms.appinvite.AppInviteActivity.onStart(:com.google.android.gms:411)
                                                                         at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)
                                                                         at android.app.Activity.performStart(Activity.java:3791)
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1731)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784) 
                                                                         at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939) 
                                                                         at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                         at android.os.Looper.loop(Looper.java:130) 
                                                                         at android.app.ActivityThread.main(ActivityThread.java:3835) 
                                                                         at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                         at java.lang.reflect.Method.invoke(Method.java:507) 
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) 
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) 
                                                                         at dalvik.system.NativeStart.main(Native Method) 
Sergio Viudes
  • 2,714
  • 5
  • 26
  • 44

3 Answers3

1

From here:

To test your app when using the Google Play services SDK, you must use either:

  • A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
  • The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

Which means any device running API > 9 or any emulator running API > 17

Edson Menegatti
  • 4,006
  • 2
  • 25
  • 40
0

Here in the sample application, they provided API 18 as the minsdk. https://github.com/googlesamples/google-services/blob/master/android/appinvites/app/build.gradle

Febi M Felix
  • 2,799
  • 1
  • 10
  • 13
  • Thanks for your answer. But I've just tested it using Jelly Bean (API 16), and it's working. So the min sdk must be lower than the one is in examples. – Sergio Viudes Mar 18 '16 at 10:51
  • @SergioViudes, can you help me with the same problem ?http://stackoverflow.com/questions/36226129/google-appinvite – Oleksandr.D Mar 26 '16 at 11:14
0

App Invites Beta has the minimum API level as other libs in Play Services.

Documentation here https://developers.google.com/android/guides/setup says that Android 2.3 is required. Bet it is API level 10 (9 is possible too).

kosev
  • 2,125
  • 1
  • 20
  • 18