【问题标题】:how to install cordova plugin from a zip file如何从 zip 文件安装 cordova 插件
【发布时间】:2015-07-18 20:56:34
【问题描述】:

我正在尝试安装 phoneRTC (https://github.com/alongubkin/phonertc),但使用 git clone 需要很长时间:

cordova plugin add https://github.com/alongubkin/phonertc.git

这就是为什么我决定只对 github 上的 zip 文件使用 wget:

wget https://github.com/alongubkin/phonertc/archive/master.zip

现在我的电脑上有插件了。我尝试提取 zip 文件并将其放在我的项目的 plugins 目录中,并将文件夹重命名为与 config.xml 文件中的 id 相同:

com.dooble.phonertc

但是当我尝试构建 apk 文件时,出现以下错误:

/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.

任何想法有什么问题吗?我错过了什么?提前致谢

【问题讨论】:

    标签: android cordova phonertc


    【解决方案1】:

    解压缩插件并像这样安装它:

    cordova plugin add /path/to/the/uncompressed/folder
    

    【讨论】:

      【解决方案2】:

      我已经通过 Relplacing 解决了这个问题

      webView.addView(_videoView);

      ((WebView) webView.getView()).addView(_videoView); 
      

      webView.addView(_videoView);

       ((WebView) webView.getView()).addView(_videoView); 
      

      我知道这是一个老问题,但希望对某人有所帮助。

      【讨论】:

        猜你喜欢
        • 2011-07-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多