opentok / cordova-plugin-opentok

Cordova Plugin for OpenTok - add webrtc video to your iOS or Android App
MIT License
30 stars 80 forks source link

Android Build Failure: Variable needs to be declared final #158

Open philipjbrowning opened 5 years ago

philipjbrowning commented 5 years ago

Bug Report

Current behavior The build fails because callbackContext and runsub should be declared with final. Adding final to those variables makes the build succeed.

Steps to reproduce Run ionic cordova build android

What is the current bug behavior? Build failure

What is the expected correct behavior? Build successful

Relevant logs and/or screenshots

BUILD FAILED in 6s
38 actionable tasks: 38 executed
(node:20320) UnhandledPromiseRejectionWarning: Error:
/platforms/android/gradlew: Command failed with exit code 1 Error output:
/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:674: error: local variable callbackContext is accessed from within inner class; needs to be declared final
                        myPublisher.getImgData(callbackContext);
                                               ^
/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:683: error: local variable runsub is accessed from within inner class; needs to be declared final
                           runsub.getImgData(callbackContext);
                           ^
/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:683: error: local variable callbackContext is accessed from within inner class; needs to be declared final
                           runsub.getImgData(callbackContext);
                                             ^

Ionic Info

Ionic:

   ionic (Ionic CLI)  : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 6.4.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic 5.2.1, cordova-plugin-ionic-webview 3.1.0, cordova-plugin-opentok 3.4.3 (and 15 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.9.0 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61