Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference #181

Open
1 task done
aprilmintacpineda opened this issue Dec 10, 2020 · 2 comments

Comments

@aprilmintacpineda
Copy link

Report

Environment

  • Platforms: Android
  • Android version: 10
  • iOS version: N/A

Issues and Steps to Reproduce

I have not tested this on iOS, but on android, whenever I tap on Register, the following error gets logged:

Error: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Note that I am running the code I got from https://github.com/CatalystCode/react-native-azurenotificationhub/blob/master/docs/android-installation.md#javascript-configuration and only changed the connectionString and hubName to their correct values. The error is vague and I'm unsure what it's referring to...

image

Expected Behavior

The error shouldn't be thrown.

Actual Behavior

The error is thrown.

Link to Code

N/A

@aprilmintacpineda
Copy link
Author

this happens on the register call, the register is successful, but the _onAzureNotificationHubRegistrationError logs with that error afterwards.

@aprilmintacpineda
Copy link
Author

Here's the whole log from Android studio:

E/ReactNativeRegistration: Failed to complete token refresh
    java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
        at java.net.URI$Parser.parse(URI.java:3086)
        at java.net.URI.<init>(URI.java:583)
        at java.net.URI.create(URI.java:845)
        at com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:147)
        at com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:132)
        at com.microsoft.windowsazure.messaging.NotificationHub.refreshRegistrationInformation(NotificationHub.java:297)
        at com.microsoft.windowsazure.messaging.NotificationHub.registerInternal(NotificationHub.java:391)
        at com.microsoft.windowsazure.messaging.NotificationHub.register(NotificationHub.java:144)
        at com.azure.reactnative.notificationhub.ReactNativeRegistrationIntentService$1.onSuccess(ReactNativeRegistrationIntentService.java:73)
        at com.azure.reactnative.notificationhub.ReactNativeRegistrationIntentService$1.onSuccess(ReactNativeRegistrationIntentService.java:53)
        at com.google.android.gms.tasks.zzn.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

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

No branches or pull requests

1 participant