cordova-plugin-opentok
cordova-plugin-opentok copied to clipboard
Build failure
Bug Report
Current behavior Can't build using JDK 1.8, Gradle 2.10 Node version: v6.14.3 Cordova version: 7.1.0
Available Android targets:
----------
id: 1 or "android-23"
Name: Android API 23
Type: Platform
API level: 23
Revision: 3
----------
id: 2 or "android-26"
Name: Android API 26
Type: Platform
API level: 26
Revision: 2
Steps to reproduce
- Git clone the following repository (master branch) https://github.com/opentok/opentok-cordova-samples/tree/master/Basic-Video-Chat
- issue a cordova build command
Example Project https://github.com/opentok/opentok-cordova-samples/tree/master/Basic-Video-Chat
What is the current bug behavior? The build fails.
What is the expected correct behavior? The build shall succeed.
Relevant logs and/or screenshots
BUILD FAILED in 9s
28 actionable tasks: 4 executed, 24 up-to-date
Error: /src/platforms/android/gradlew: Command failed with exit code 1 Error output:
/src/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:673: error: local variable callbackContext is accessed from within inner class; needs to be declared final
myPublisher.getImgData(callbackContext);
^
/src/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:682: error: local variable runsub is accessed from within inner class; needs to be declared final
runsub.getImgData(callbackContext);
^
/src/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:682: error: local variable callbackContext is accessed from within inner class; needs to be declared final
runsub.getImgData(callbackContext);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
@scdyn This looks like an issue with the samples repo because the samples haven't been updated to use the latest plugin.
I just create a sample video chat and added this plugin as a dependency and am able to publish and subscribe successfully. I am not seeing any build failures.
Disagree this is an error introduced on the version 3.4.0
Sent from my iPhone
On Sep 18, 2018, at 6:50 PM, Manik Sachdeva [email protected] wrote:
@scdyn This looks like an issue with the samples repo because the samples haven't been updated to use the latest plugin.
I just create a sample video chat and added this plugin as a dependency and am able to publish and subscribe successfully. I am not seeing any build failures.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hmm, can you create a basic sample application using cordova create
and then add the plugin? I did the following and didn't have to modify anything in the plugin to make it work:
-
cordova create sampleapp
-
cordova plugin add cordova-plugin-opentok
-
cordova platform add android
- Add the script tag with opentok.js to the
index.html
file - Add the basic code from Basic-Video-Chat Sample
-
cordova prepare android
- Open the project in the Android Studio and run on a Pixel 2 with API 27
@scdyn @bpowell15 Can you share any feedback that you have? Would love to see how I can reproduce it so we can patch it if needed.
I dont know much about java but i was able to add “final” to the lines mentioned in the error and build successfully. Also downgrading the version to 3.3.0 and then removing plugins and reintstalling fixes the issue.
Sent from my iPhone
On Sep 19, 2018, at 12:14 PM, Manik Sachdeva [email protected] wrote:
@scdyn @bpowell15 Can you share any feedback that you have? Would love to see how I can reproduce it so we can patch it if needed.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I actually followed issues for this plugin originally bc I was having this issue. I started to submit a MR with the fix but then was able to build without the changes. Now that I have looked closer at why it started working I realized that the version was changed from 3.4.0 to 3.3.0
Sent from my iPhone
On Sep 19, 2018, at 12:14 PM, Manik Sachdeva [email protected] wrote:
@scdyn @bpowell15 Can you share any feedback that you have? Would love to see how I can reproduce it so we can patch it if needed.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@msach22 Can't try this before the end of the week, I'll get back to you by then. I don't build through Android Studio, do you think it can make the difference ?
I build through the command line as well , maybe it has to do with different java versions?
Sent from my iPhone
On Sep 20, 2018, at 2:57 AM, scdyn [email protected] wrote:
@msach22 Can't try this before the end of the week, I'll get back to you by then. I don't build through Android Studio, do you think it can make the difference ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Same error here
@bpowell15 and @videmort Could you folks please share your Java version?
@msach22
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
@scdyn I managed to get the build working again in my PR #130 in case you want to try it