AirshipChannelListener.onChannelCreated called with a null channel ID even when the interface defines it NonNull

Steps: Unknown, most likely just starting up the application.
Device: Samsung Galaxy Note 4, Android 6
Occurrance: Extremely rare, happened so far only for one end user. We are not able to reproduce this.
SDK version: 14.1.1



The root cause of the problem is that we use Kotlin with the SDK and AirshipChannelListener interface defines channelId as NonNull but when Airship creates a channel it has for some reason been null. AirshipChannel should not be calling this method with a null channel ID.

public interface AirshipChannelListener {

void onChannelCreated(@NonNull String channelId);


As our Kotlin code implements that interface, Kotlin compiler will enforce nullability and cause application to crash by calling Intrinsics.checkNotNullParameter(channelId, "channelId");

We could solve this issue by using Java to implement that interface or by removing Kotlin intrinsics e.g. with R8 or compiler flag.

Additionally we are not using onChannelCreated for anything but we are forced to overwrite it to use onChannelUpdated callback. One option to improve interface segregation principle is to include an empty implementation for this interface in the SDK.

Manifest & build.gradle:

For now I did not include this as there is nothing out of the ordinary and it works for everyone except a single user at this time. We use autopilot so takeOff is not called by app.

Stack trace:

Fatal Exception: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter channelId
at com.urbanairship.job.Job$
at com.urbanairship.util.SerialExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at com.urbanairship.util.AirshipThreadFactory$

Didn't find what you were looking for?

New post


1 comment

Please sign in to leave a comment.