Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Crash NullPointerException #7

Open
DoaiNguyen opened this issue Jun 10, 2016 · 6 comments
Open

Crash NullPointerException #7

DoaiNguyen opened this issue Jun 10, 2016 · 6 comments

Comments

@DoaiNguyen
Copy link

Fatal Exception: java.lang.RuntimeException: Unable to start service com.google.android.gms.analytics.CampaignTrackingService@21d41e58 with null: java.lang.NullPointerException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2886)
at android.app.ActivityThread.access$2100(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
at com.google.android.gms.analytics.CampaignTrackingService.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2869)
at android.app.ActivityThread.access$2100(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(NativeStart.java)

@djabi
Copy link
Contributor

djabi commented Jun 10, 2016

This issue is caused by sending an broadcast with null intent (not a normal situation). The issue has been fixed in the latest Google Play Service release (9.0.x). Please update that app.

@krishnachaitanya9984
Copy link

We are using latest google play services(9.0.2) and we are still seeing the following issue

Fatal Exception: java.lang.RuntimeException: Unable to start service com.google.android.gms.analytics.CampaignTrackingService@ed0a66d with null: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3334)
at android.app.ActivityThread.access$2200(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
at com.google.android.gms.analytics.CampaignTrackingService.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3317)
at android.app.ActivityThread.access$2200(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

@andreiverdes
Copy link

Still seen in Google Play Services 9.6.1

@afedorychak
Copy link

play-services-analytics-impl 10.2.6

Fatal Exception: java.lang.RuntimeException: Unable to start service com.google.android.gms.analytics.CampaignTrackingService@7573900 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3450)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1633)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6314)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
       at com.google.android.gms.analytics.CampaignTrackingService.onStartCommand(Unknown Source)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3433)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1633)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6314)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)```

@thundertrick
Copy link

Still seen in 9.8.0. I check the code in CampaignTrackingService.class. The bug does not seem to be fixed.

@RequiresPermission(
    allOf = {"android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE"}
)
public int onStartCommand(Intent var1, int var2, final int var3) {
    this.zzyz();
    zzf var4 = zzf.zzaw(this);
    final zzaf var5 = var4.zzaca();
    String var6 = null;
    var4.zzacb();
    boolean var10000 = false;
    var6 = var1.getStringExtra("referrer"); // ------- var1 might be null
    final Handler var7 = this.getHandler();
    if(TextUtils.isEmpty(var6)) {
        var4.zzacb();
        if(true) {
            var5.zzev("No campaign found on com.android.vending.INSTALL_REFERRER \"referrer\" extra");
        }

        var4.zzacc().zzg(new Runnable() {
            public void run() {
                CampaignTrackingService.this.zza(var5, var7, var3);
            }
        });
        return 2;
    } else {
        int var9 = var4.zzacb().zzaei();
        String var8;
        if(var6.length() <= var9) {
            var8 = var6;
        } else {
            var5.zzc("Campaign data exceed the maximum supported size and will be clipped. size, limit", Integer.valueOf(var6.length()), Integer.valueOf(var9));
            var8 = var6.substring(0, var9);
        }

        var5.zza("CampaignTrackingService called. startId, campaign", Integer.valueOf(var3), var8);
        var4.zzzg().zza(var8, new Runnable() {
            public void run() {
                CampaignTrackingService.this.zza(var5, var7, var3);
            }
        });
        return 2;
    }
}

@thundertrick
Copy link

According the newest official reference, the service was deprecated.

This Service is no longer invoked. Campaign tracking happens in the receiver only. Remains for compatibility reasons.

Besides, InstallReferrerService extends from CampaignTrackingService is used instead.

So I guess its time to remove CampaignTrackingService from AndroidManifest and close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants