Cordova构建错误 - 退出代码1失败 - ant / build.xml

时间:2015-05-25 07:36:29

标签: android cordova

我可以使用cordova run android轻松地在移动设备上构建和运行我的应用。在我使用--release构建发布版本后,一切都开始出错(我成功获得了发布版本)。现在一切都搞砸了 - 我根本无法成功构建我的应用程序。

我的路径/ cordova / ant:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/imac/android-sdks/platform-tools/:/Users/imac/android-sdks/tools:/Users/imac/android-sdks/platform-tools

$ cordova -v
5.0.0

$ ant -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014

错误已经从这里开始:(我删除了很多行,因为大多数似乎相似)

-compile:
    [javac] Compiling 17 source files to /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/ant-build/classes
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25: cannot find symbol
    [javac] symbol  : class ClientCertRequest
    [javac] location: package android.webkit
    [javac] import android.webkit.ClientCertRequest;
    [javac]                      ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:32: cannot find symbol
    [javac] symbol  : class ClientCertRequest
    [javac] location: class org.apache.cordova.CordovaClientCertRequest
    [javac]     private final ClientCertRequest request;
    [javac]                   ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:34: cannot find symbol
    [javac] symbol  : class ClientCertRequest
    [javac] location: class org.apache.cordova.CordovaClientCertRequest
    [javac]     public CordovaClientCertRequest(ClientCertRequest request) {
    [javac]                                     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:47: interface expected here
    [javac] public class CordovaWebViewImpl implements CordovaWebView {
    [javac]                                            ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java:24: org.apache.cordova.ExposedJsApi is not public in org.apache.cordova; cannot be accessed from outside package
    [javac] import org.apache.cordova.ExposedJsApi;
    [javac]                          ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java:32: cannot find symbol
    [javac] symbol: class ExposedJsApi
    [javac] class SystemExposedJsApi implements ExposedJsApi {
    [javac]                                     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java:251: cannot find symbol
    [javac] symbol  : class FileChooserParams
    [javac] location: class android.webkit.WebChromeClient
    [javac]     public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]> filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
    [javac]                                                                                                                          ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:29: cannot find symbol
    [javac] symbol  : class ClientCertRequest
    [javac] location: package android.webkit
    [javac] import android.webkit.ClientCertRequest;
    [javac]                      ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:116: cannot find symbol
    [javac] symbol  : class ClientCertRequest
    [javac] location: class org.apache.cordova.engine.SystemWebViewClient
    [javac]     public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
    [javac]                                                            ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java:249: cannot find symbol
    [javac] symbol  : variable LOLLIPOP
    [javac] location: class android.os.Build.VERSION_CODES
    [javac]     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    [javac]                                   ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java:141: cannot find symbol
    [javac] symbol  : method getServiceName()
    [javac] location: class org.apache.cordova.CordovaPlugin
    [javac]             String serviceName = activityResultCallback.getServiceName();
    [javac]                                                        ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:102: cannot find symbol
    [javac] symbol  : constructor PluginManager(org.apache.cordova.CordovaWebViewImpl,org.apache.cordova.CordovaInterface,java.util.List<org.apache.cordova.PluginEntry>)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         pluginManager = new PluginManager(this, this.cordova, pluginEntries);
    [javac]                         ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:104: cannot find symbol
    [javac] symbol  : constructor NativeToJsMessageQueue()
    [javac] location: class org.apache.cordova.NativeToJsMessageQueue
    [javac]         nativeToJsMessageQueue = new NativeToJsMessageQueue();
    [javac]                                  ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:105: cannot find symbol
    [javac] symbol  : class NoOpBridgeMode
    [javac] location: class org.apache.cordova.NativeToJsMessageQueue
    [javac]         nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode());
    [javac]                                                                        ^
  symbol
    [javac] symbol  : method shouldOpenExternalUrl(java.lang.String)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         if (!pluginManager.shouldOpenExternalUrl(url)) {
    [javac]                           ^
  content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:314: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:318: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:322: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:326: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:330: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:334: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:351: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:369: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:374: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:380: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:385: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:391: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:396: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:401: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:407: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:412: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:418: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:424: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:439: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:458: cannot find symbol
    [javac] symbol  : method onStart()
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         pluginManager.onStart();
    [javac]                      ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:453: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:465: cannot find symbol
    [javac] symbol  : method onStop()
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         pluginManager.onStop();
    [javac]                      ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:460: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:467: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:599: cannot find symbol
    [javac] symbol  : method shouldAllowNavigation(java.lang.String)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]             } else if (pluginManager.shouldAllowNavigation(url)) {
    [javac]                                     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewImpl.java:601: cannot find symbol
    [javac] symbol  : method shouldOpenExternalUrl(java.lang.String)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]             } else if (pluginManager.shouldOpenExternalUrl(url)) {
    [javac]                                     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:89: cannot find symbol
    [javac] symbol  : method getPluginManager()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]                         webView.getPluginManager().postMessage("spinner", "stop");
    [javac]                                ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:266: cannot find symbol
    [javac] symbol  : method getPluginManager()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]         this.webView.getPluginManager().postMessage("exit", null);
    [javac]                     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:290: cannot find symbol
    [javac] symbol  : method getPluginManager()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]                             webView.getPluginManager().postMessage("telephone", "ringing");
    [javac]                                    ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:294: cannot find symbol
    [javac] symbol  : method getPluginManager()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]                             webView.getPluginManager().postMessage("telephone", "offhook");
    [javac]                                    ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/CoreAndroid.java:298: cannot find symbol
    [javac] symbol  : method getPluginManager()
    [javac] location: class org.apache.cordova.CordovaWebView
    [javac]                             webView.getPluginManager().postMessage("telephone", "idle");
    [javac]                                    ^

    [javac]                          ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java:59: cannot find symbol
    [javac] symbol  : variable LOLLIPOP
    [javac] location: class android.os.Build.VERSION_CODES
    [javac]         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    [javac]                                                         ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java:60: cannot find symbol
    [javac] symbol  : method flush()
    [javac] location: class android.webkit.CookieManager
    [javac]             cookieManager.flush();
    [javac]                          ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java:257: cannot find symbol
    [javac] symbol  : variable FileChooserParams
    [javac] location: class android.webkit.WebChromeClient
    [javac]                     Uri[] result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
    [javac]                                                   ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java:250: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java:99: org.apache.cordova.NativeToJsMessageQueue.OnlineEventsBridgeMode has private access in org.apache.cordova.NativeToJsMessageQueue
    [javac]         nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode.OnlineEventsBridgeModeDelegate() {
    [javac]                                                                        ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java:99: org.apache.cordova.NativeToJsMessageQueue.OnlineEventsBridgeMode has private access in org.apache.cordova.NativeToJsMessageQueue
    [javac]         nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode.OnlineEventsBridgeModeDelegate() {
    [javac]                                                                                                                          ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:98: cannot find symbol
    [javac] symbol  : method onReceivedHttpAuthRequest(<nulltype>,org.apache.cordova.CordovaHttpAuthHandler,java.lang.String,java.lang.String)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(null, new CordovaHttpAuthHandler(handler), host, realm)) {
    [javac]                                                   ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:121: cannot find symbol
    [javac] symbol  : method onReceivedClientCertRequest(<nulltype>,org.apache.cordova.CordovaClientCertRequest)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]         if (pluginManager != null && pluginManager.onReceivedClientCertRequest(null, new CordovaClientCertRequest(request))) {
    [javac]                                                   ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:114: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:144: reset(java.lang.String) in org.apache.cordova.CordovaBridge cannot be applied to ()
    [javac]         parentEngine.bridge.reset();
    [javac]                            ^
    [javac] /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewClient.java:325: cannot find symbol
    [javac] symbol  : method shouldAllowRequest(java.lang.String)
    [javac] location: class org.apache.cordova.PluginManager
    [javac]             if (!parentEngine.pluginManager.shouldAllowRequest(url)) {
    [javac]                                            ^
    [javac] Note: /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebChromeClient.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 73 errors

BUILD FAILED
/Users/imac/android-sdks/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/imac/android-sdks/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/imac/android-sdks/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second

/Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: ant with args: debug,-f,/Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
ERROR building one of the platforms: Error: /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Applications/MAMP/htdocs/mesar/wp-content/themes/mesar/mobile/platforms/android/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

任何帮助表示赞赏!

0 个答案:

没有答案