为 android 构建时缺少 class 文件 - pusher_channels_flutter

Missing class file when builidng for android - pusher_channels_flutter

为 Android 构建时的错误消息:

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

如前所述,here 在应用级别 build.gradle 文件中添加推送器 java 客户端依赖项可解决问题。

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

添加到:

your_project_folder/android/app/build.gradle