'Missing class file when builidng for android - pusher_channels_flutter

Error message when building for Android:

error: cannot access ConnectionEventListener
      flutterEngine.getPlugins().add(new com.pusher.channels_flutter.PusherChannelsFlutterPlugin());
                                ^
  class file for com.pusher.client.connection.ConnectionEventListener not found


Solution 1:[1]

As mentioned here adding the pusher java client dependancy in the app level build.gradle file fixes the issue.

dependencies {
    ...
    implementation 'com.pusher:pusher-java-client:2.2.8'
}

Add to:

your_project_folder/android/app/build.gradle

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1