I just upgrade my Android OS to Lollipop (5.0). I'm now getting an error when attempting to get my device token: Attempt to invoke virtual method 'void com.arellomobile.android.push.PushManager.registerForPushNotifications()' on a null object reference.

Anyone else experiencing this / have workarounds?

Thanks!

asked 22 Nov '14, 20:38
joelcogley's gravatar image

joelcogley
1713

Hey, did you get it fixed? I'm having same issue

(01 Jan '15, 19:40) bend0303 bend0303's gravatar image

did you forget to call onDeviceReady?

(16 Feb '15, 13:32) shader shader's gravatar image

@banzaimedia I am having no issues with PW running Cordova on Lollipop.

permanent link
answered 14 Jan '15, 14:58
synergyw's gravatar image

synergyw
315

Glad for you, I'm not using Cordova at all so I'm only supporting what @joelcogley said by confirming that the SAME EXACT ERROR MESSAGE appears on Titanium too, so the issue is definitely there.

I can't say if this happens always, on all devices, on all configs.

That's typical bug's life ;-)

(15 Jan '15, 11:28) banzaimedia banzaimedia's gravatar image

Could you please paste full logs?

Somehow Cordova lost reference to the plugin.

permanent link
answered 24 Nov '14, 06:42
shader's gravatar image

shader
3.9k7

Hey did you get any info regard that error? Pushwoosh registration not working on Android 5 with same error

(01 Jan '15, 19:40) bend0303 bend0303's gravatar image

@bend0303 could you please send your logs then?

(02 Jan '15, 15:04) Alex Spotar Alex%20Spotar's gravatar image

Hi shader,

same problem here but using Titanium on a Nexus 5 with Android 5. Here is the full log of a failed unregister/register sequence:

[ERROR] : [Nexus 5] Pushwoosh: Request manager: ERROR: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference. Response = null
[ERROR] : [Nexus 5] Pushwoosh: Request manager: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.StatusLine.<init>(StatusLine.java:24)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.Response$Builder.statusLine(Response.java:419)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.JavaApiConverter.createOkResponse(JavaApiConverter.java:116)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.ResponseCacheAdapter.get(ResponseCacheAdapter.java:53)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:190)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
[ERROR] : [Nexus 5] Pushwoosh: Request manager: at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)

permanent link
answered 13 Jan '15, 10:34
banzaimedia's gravatar image

banzaimedia
212

edited 26 Jan '15, 10:09

shader's gravatar image

shader
3.9k7

For some reason Titanium tried to cache "POST" request and crashes. Caching POST requests are not allowed. Which Titanium version do you use?

(13 Jan '15, 17:08) shader shader's gravatar image

The latest official SDK 3.4.1.

But the same exact build works on all Android 4.x devices, the issue is only on Lollipop. Did you look at an actual run or are you guessing Titanium is caching the request by the class names? Please note that use of the okhttp classes and methods has been modified by Google several times in recent Google Play Services deployments, so this may have been introduced there.

By the way, if it is the same error on Titanium and on Cordova, looks like it's between your code and the OS.

(13 Jan '15, 17:22) banzaimedia banzaimedia's gravatar image

@shader, any news on this? It is very critical for us...

(19 Jan '15, 18:34) banzaimedia banzaimedia's gravatar image

You need to update Titanium SDK: See the following problems in their JIRA https://jira.appcelerator.org/browse/TIMOB-17477 https://jira.appcelerator.org/browse/TIMOB-17877

(26 Jan '15, 10:07) shader shader's gravatar image

I'm already using the 3.4.1 SDK which fixed those tickets. Anyway, I provided the PW support team with a basic project that replicates the issue, so let's wait for their investigation.

(26 Jan '15, 11:35) banzaimedia banzaimedia's gravatar image

The problem is in the TiResponseCache.java file. Considering the comments 3.4.1 SDK still experience the same issue. :( see this: https://github.com/appcelerator/titanium_mobile/pull/6256/files

(16 Feb '15, 13:32) shader shader's gravatar image

The Pushwoosh issue is still there with SDK 3.5.0, which came long after the most recent activity on those tickets.

Still a bit perplexed since the same problem is in Cordova and TiResponseCache is obviously not part of Cordova.

The Response Cache saga started with a Google Play Services release which broke a lot of things, to the point where the Google team rolled back the global release. See this https://jira.appcelerator.org/browse/TIMOB-17798

(16 Feb '15, 14:04) banzaimedia banzaimedia's gravatar image
showing 5 of 7 show 2 more comments

Hi. I have same problem on Motorola G Lollipop 5.0.2. Here is a log:

03-25 23:38:18.236: W/System.err(17766): at com.pushwoosh.plugin.pushnotifications.PushNotifications.initialize(PushNotifications.java:175) 03-25 23:38:18.236: W/System.err(17766): at com.pushwoosh.plugin.pushnotifications.PushNotifications.execute(PushNotifications.java:384) 03-25 23:38:18.236: W/System.err(17766): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:84) 03-25 23:38:18.236: W/System.err(17766): at org.apache.cordova.PluginManager.exec(PluginManager.java:151) 03-25 23:38:18.236: W/System.err(17766): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63) 03-25 23:38:18.236: W/System.err(17766): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40) 03-25 23:38:18.236: W/System.err(17766): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 03-25 23:38:18.236: W/System.err(17766): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:28) 03-25 23:38:18.236: W/System.err(17766): at android.os.Handler.dispatchMessage(Handler.java:102) 03-25 23:38:18.236: W/System.err(17766): at android.os.Looper.loop(Looper.java:135) 03-25 23:38:18.236: W/System.err(17766): at android.os.HandlerThread.run(HandlerThread.java:61) 03-25 23:38:18.236: W/PluginManager(17766): THREAD WARNING: exec() call to PushNotification.onDeviceReady blocked the main thread for 25ms. Plugin should use CordovaInterface.getThreadPool(). 03-25 23:38:18.265: D/PushNotifications(17766): Plugin Called 03-25 23:38:18.265: W/System.err(17766): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.arellomobile.android.push.PushManager.registerForPushNotifications()' on a null object reference 03-25 23:38:18.266: W/System.err(17766): at com.pushwoosh.plugin.pushnotifications.PushNotifications.internalRegister(PushNotifications.java:191) 03-25 23:38:18.266: W/System.err(17766): at com.pushwoosh.plugin.pushnotifications.PushNotifications.execute(PushNotifications.java:392) 03-25 23:38:18.266: W/System.err(17766): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:84) 03-25 23:38:18.266: W/System.err(17766): at org.apache.cordova.PluginManager.exec(PluginManager.java:151) 03-25 23:38:18.266: W/System.err(17766): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63) 03-25 23:38:18.266: W/System.err(17766): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40) 03-25 23:38:18.266: W/System.err(17766): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 03-25 23:38:18.266: W/System.err(17766): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:28) 03-25 23:38:18.266: W/System.err(17766): at android.os.Handler.dispatchMessage(Handler.java:102) 03-25 23:38:18.266: W/System.err(17766): at android.os.Looper.loop(Looper.java:135) 03-25 23:38:18.267: W/System.err(17766): at android.os.HandlerThread.run(HandlerThread.java:61)

permanent link
answered 25 Mar '15, 21:25
justice's gravatar image

justice
111

Been a while now. I am encountering this error as well. Any update? Running: phonegap 4.2.0 pushwoosh 3.5.1

permanent link
answered 28 Apr '15, 04:33
foliba's gravatar image

foliba
111

I am building this app through the AppGyver Build service. The plugin is included fine (I use window.plugins.pushNotification instead of cordova.require(...)). But I am seeing the following error in my registerDevice call:

Attempt to invoke virtual method 'void com.arellomobile.android.push.PushManager.registerForPushNotifications()' on a null object reference

I am following the tutorial very closely, but can't get past registering devices. Any help would be great! I see that the threads here are several months old so hopefully the Pushwoosh team has looked into this.

Update: It's fixed. See my comments

permanent link
answered 16 Jul '15, 21:11
social-team-cdk's gravatar image

social-team-cdk
113

edited 16 Jul '15, 22:29

I have gotten the plugin to work! It seems that the Cordova SDK is very particular when it asks for a body onload attribute. After adding that, the plugin works.

(16 Jul '15, 22:28) social-team-cdk social-team-cdk's gravatar image

Can you explain better how you fixed it?

(04 Dec '15, 15:54) harding harding's gravatar image
-2

Unfortunately, the solution I found was to stop using pushwoosh. After backing everything out, I started over with the native Cordova plugin which I finally got working.

permanent link
answered 01 Jan '15, 20:36
joelcogley's gravatar image

joelcogley
1713

I'm very sorry to hear that. I'm sure the logs would helped that time to identify the issue and resolve the issue.

(07 Jan '15, 09:18) shader shader's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×447
×326
×190

question asked: 22 Nov '14, 20:38

question was seen: 4,895 times

last updated: 04 Dec '15, 15:54