registerReceivers();

      //Create and start push manager
      final PushManager pushManager = PushManager.getInstance(this);
          //PushManager.getInstance(this); returned null

      //Start push manager, this will count app open for Pushwoosh stats as well
      try {
             pushManager.onStartup(this);
      }
      catch(Exception e)
      {
             //push notifications are not available or AndroidManifest.xml is not configured properly
      }

      //Register for push!
      pushManager.registerForPushNotifications(); //this line error reason pushManager is null

      checkMessage(getIntent());

//Log Cat

02-24 15:57:20.159: I/System.out(22959): Tried to get instance of PushManager with no Pushwoosh App ID or Project Id set 02-24 15:57:20.159: D/AndroidRuntime(22959): Shutting down VM 02-24 15:57:20.159: W/dalvikvm(22959): threadid=1: thread exiting with uncaught exception (group=0x419fbe48) 02-24 15:57:20.169: E/AndroidRuntime(22959): FATAL EXCEPTION: main 02-24 15:57:20.169: E/AndroidRuntime(22959): Process: com.enrollment.conform, PID: 22959 02-24 15:57:20.169: E/AndroidRuntime(22959): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.enrollment.conform/org.cocos2dx.cpp.AppActivity}: java.lang.NullPointerException 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2203) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2253) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread.access$800(ActivityThread.java:142) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.os.Handler.dispatchMessage(Handler.java:102) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.os.Looper.loop(Looper.java:136) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread.main(ActivityThread.java:5120) 02-24 15:57:20.169: E/AndroidRuntime(22959): at java.lang.reflect.Method.invokeNative(Native Method) 02-24 15:57:20.169: E/AndroidRuntime(22959): at java.lang.reflect.Method.invoke(Method.java:515) 02-24 15:57:20.169: E/AndroidRuntime(22959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 02-24 15:57:20.169: E/AndroidRuntime(22959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) 02-24 15:57:20.169: E/AndroidRuntime(22959): at dalvik.system.NativeStart.main(Native Method) 02-24 15:57:20.169: E/AndroidRuntime(22959): Caused by: java.lang.NullPointerException 02-24 15:57:20.169: E/AndroidRuntime(22959): at org.cocos2dx.cpp.AppActivity.onCreate(AppActivity.java:98) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.Activity.performCreate(Activity.java:5275) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 02-24 15:57:20.169: E/AndroidRuntime(22959): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167) 02-24 15:57:20.169: E/AndroidRuntime(22959): ... 11 more

please help :(

asked 24 Feb '15, 09:13
mong's gravatar image

mong
12

solve it !

PW_PROJECT_ID – Project Number you receive from Google (Locate your Project Number) prefixed with A.

just 'A'....

sry

permanent link
answered 24 Feb '15, 10:55
mong's gravatar image

mong
12

I'm still having this problem. I have the A prefix in my PW_PROJECT_ID, but the cause seems to be something else. Been trying to fix this for two days now. I have no clue what is causing this. The main problem seems to be that the instance of the the PushManager is null:

PushManager pushManager = PushManager.getInstance(this);

My stack trace:

07-06 10:49:41.018 6439-6439/com.foobar.FOOBARAPP I/Pushwoosh: Log level: NOISE
07-06 10:49:41.028 6439-6439/com.foobar.FOOBARAPP E/Pushwoosh: [PushManager] Tried to get instance of PushManager with no Pushwoosh App ID or Project Id set
07-06 10:49:41.028 6439-6439/com.foobar.FOOBARAPP D/AndroidRuntime: Shutting down VM
07-06 10:49:41.028 6439-6439/com.foobar.FOOBARAPP E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: com.foobar.FOOBARAPP, PID: 6439
                                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.foobar.FOOBARAPP/com.foobar.FOOBARAPP.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.PushManager.registerForPushNotifications()' on a null object reference
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
                                                                       at android.app.ActivityThread.access$900(ActivityThread.java:172)
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                       at android.os.Looper.loop(Looper.java:145)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5832)
                                                                       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:1399)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
                                                                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.PushManager.registerForPushNotifications()' on a null object reference
                                                                       at com.foobar.FOOBARAPP.MainActivity.onCreate(MainActivity.java:56)
                                                                       at android.app.Activity.performCreate(Activity.java:6221)
                                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2611)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723) 
                                                                       at android.app.ActivityThread.access$900(ActivityThread.java:172) 
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422) 
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                       at android.os.Looper.loop(Looper.java:145) 
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5832) 
                                                                       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:1399) 
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
permanent link
answered 06 Jul '16, 09:56
zacrotus's gravatar image

zacrotus
113

Okay, I just solved this by placing the meta-data tags correctly in the AndroidManifest.xml. See my comment here: https://community.pushwoosh.com/questions/1007/android-integration-problem

permanent link
answered 06 Jul '16, 10:17
zacrotus's gravatar image

zacrotus
113

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
×30
×23

question asked: 24 Feb '15, 09:13

question was seen: 2,040 times

last updated: 06 Jul '16, 10:17