I'd like to implement Journey Builder next to custom implementation for other push handler (we would like to have Journey Builder, Mixpanel and our own implementation in one app).
The issue which we have is NullPointerException which looks like this one:
FATAL EXCEPTION: AsyncTask #1
Process: com.azimo.sendmoney.debug1, PID: 24805
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818
And it occurs only when we have implemented both Mixpanel and Journey Builder (they both work separately).
Code which causes issue looks like this:
<service
android:name=".a.backend.service.GcmMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
And the implementation:
public class GcmMessagingService extends GcmListenerService {
@Inject
GcmHandlerManager gcmHandlerManager;
@Override
public void onCreate() {
super.onCreate();
AzimoApplication.get(this).getComponent().inject(this);
}
public void onMessageReceived(String from, Bundle data) {
gcmHandlerManager.handle(from, data);
}
}
When I remove declaration from Manifest app will start working.
Whole implementation of Journey Builder is done like it's described in documentation.