alongubkin / phonertc

WebRTC for Cordova apps - No longer active
http://phonertc.io
Apache License 2.0
867 stars 305 forks source link

build failing when phonertc is installed #151

Open anchetaWern opened 9 years ago

anchetaWern commented 9 years ago

I'm trying to install this plugin for my ionic project. I used this command to install:

ionic plugin add https://github.com/alongubkin/phonertc.git --verbose

And I got this as a response:

Install start for "com.dooble.phonertc" on browser.
Beginning processing of action stack for browser project...
Action stack processing complete.
Preparing browser project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'com.ionic.keyboard',
  'cordova-plugin-camera',
  'cordova-plugin-whitelist',
  'org.apache.cordova.console',
  'org.apache.cordova.device',
  'org.apache.cordova.file',
  'org.apache.cordova.file-transfer',
  'org.apache.cordova.splashscreen',
  'com.dooble.phonertc' ]
Writing out cordova_plugins.js...
Install complete for com.dooble.phonertc on browser.
Running command: /home/wern/www/chatapp/chatapp/hooks/after_plugin_add/010_register_plugin.js /home/wern/www/chatapp/chatapp
Installing plugin from url
got pluginXmlPath: /home/wern/www/chatapp/chatapp/https:/github.com/alongubkin/phonertc.git/plugin.xml
Command finished with error code 0: /home/wern/www/chatapp/chatapp/hooks/after_plugin_add/010_register_plugin.js /home/wern/www/chatapp/chatapp

It seems to have been installed without problems. But when I run ionic build android to build the apk, I get this error:

:compileDebugJava/home/wern/www/chatapp/chatapp/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:316: error: cannot find symbol
        webView.addView(_videoView, _videoParams);
               ^
  symbol:   method addView(VideoGLView,LayoutParams)
  location: variable webView of type CordovaWebView
/home/wern/www/chatapp/chatapp/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:336: error: cannot find symbol
            webView.removeView(_videoView);
                   ^
  symbol:   method removeView(VideoGLView)
  location: variable webView of type CordovaWebView
/home/wern/www/chatapp/chatapp/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:420: error: cannot find symbol
                        webView.removeView(_videoView);
                               ^
  symbol:   method removeView(VideoGLView)
  location: variable webView of type CordovaWebView
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
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJava'.
> 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.

BUILD FAILED

Total time: 57.301 secs

/home/wern/www/chatapp/chatapp/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /home/wern/www/chatapp/chatapp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/wern/www/chatapp/chatapp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/wern/www/chatapp/chatapp/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/wern/www/chatapp/chatapp/platforms/android/cordova/build: Command failed with exit code 8
    at ChildProcess.whenDone (/home/wern/.nvm/v0.10.33/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Any ideas on what the problem is?

Iliyass commented 9 years ago

The same issue here !!! please help.

spmeone commented 9 years ago

Me too.

gabehopper commented 9 years ago

I'm having the same issue.

gabehopper commented 9 years ago

This issue is related to Cordova 5.0.0

gabehopper commented 9 years ago

Cordova now has support for pluggable WebViews. I change webView to ((WebView) webView.getView()) and it seems to compile now:

((WebView) webView.getView()).addView(_videoView, _videoParams); ((WebView) webView.getView()).removeView(_videoView);

anchetaWern commented 9 years ago

@gabehopper where do we edit this?

gabehopper commented 9 years ago

I'll do a pull request tomorrow. Here is the changed file: https://github.com/alongubkin/phonertc/blob/37fbc103d56cc922a4d451934e93378a3977304d/src/android/com/dooble/phonertc/PhoneRTCPlugin.java

benpoulson commented 9 years ago

@gabehopper Was this merged into master? I can't seem to find any mention of this file changing.