本文介绍了将Crosswalk插件添加到Cordova Android项目后生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用最新的cordova android(5.1.0)。该项目正在建设和运行良好没有人行横道,但后我添加了crosswalk插件使用 cordova插件添加https:// github .com / crosswalk-project / cordova-plugin-crosswalk-webview.git 错误: 错误:15:53:54.127 [错误] [system.err] /用户/ cordova / platforms / android / src / org / crosswalk / engine / XWalkWebViewEngine。 java:48:错误:找不到符号 15:53:54.127 [error] [system.err] import org.xwalk.core.XWalkGetBitmapCallback; 15:53:54.128 [错误] [system.err] ^ 15:53:54.128 [错误] [system.err]符号:class XWalkGetBitmapCallback 15:53:54.128 [错误] [system.err]位置:package org.xwalk.core 15:53:54.178 [error] [system.err] / Users / or / Projects / Test / cordova / platforms / android / src /人行横道/引擎/ XWalkWebViewEngine。 java:103:错误:找不到符号 15:53:54.179 [error.rar] new XWalkGetBitmapCallback(){ 15:53:54.179 [error] [system.err] ^ 15:53:54.180 [错误] [system.err]符号:类XWalkGetBitmapCallback 15:53:54.181 [错误] [system.err] /用户/或/ Projects / Test / cordova / android / src / org / crosswalk / engine / XWalkWebViewEngine。 java:207:错误:找不到符号 15:53:54.182 [error] [system.err] webView.getExtensionManager()。loadExtension(XWALK_EXTENSIONS_FOLDER + File.separator + path); 15:53:54.182 [错误] [system.err] ^ 15:53:54.182 [错误] [system.err]符号:方法getExtensionManager() 15:53:54.182 [error] [system.err] location:变量webView类型XWalkCordovaView 15:53:54.184 [错误] [system.err] /用户/或/项目/测试/ cordova / platforms / android / src / / crosswalk / engine / XWalkCordovaView。 java:93:error:方法不覆盖或实现超类型的方法 15:53:54.185 [错误] [system.err] @覆盖 15:53:54.185 [错误] [系统.err] ^ 15:53:54.188 [ERROR] [system.err]注意:某些输入文件使用或覆盖已弃用的API。 15:53:54.188 [ERROR] [system.err]注意:有关详细信息,请使用-Xlint:deprecation重新编译。 15:53:54.188 [错误] [system.err] 4错误 15:53:54.190 [错误] [org.gradle.BuildExceptionReporter] 15:53:54.190 [错误] [org.gradle.BuildExceptionReporter] FAILURE:构建失败,出现异常。 15:53:54.191 [错误] [org.gradle.BuildExceptionReporter] 15:53:54.191 [错误] [org.gradle.BuildExceptionReporter] *出错: 15:53 :54.191 [ERROR] [org.gradle.BuildExceptionReporter]任务':compileX86DebugJavaWithJavac'的执行失败。 15:53:54.191 [错误] [org.gradle.BuildExceptionReporter]>编译失败;有关详细信息,请参阅编译器错误输出。 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 15:53:54.192 [ERROR] [org.gradle.BuildExceptionReporter]使用--stacktrace选项运行以获取堆栈跟踪。 该项目是使用Android Studio构建的。 解决方案 $ b > cordova -version ==> 5.1.1 导航到项目目录 Android平台 检查未安装crosswalk插件 li> 使用npm添加crosswalk插件 添加Android平台 建立Android专案 cordova build android 执行Android专案 I'm using the latest cordova android (5.1.0). The project is building and running fine without crosswalk, but after I add the crosswalk plugin using cordova plugin add https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.gitI get the following build error:Error:15:53:54.127 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/ XWalkWebViewEngine. java:48: error: cannot find symbol 15:53:54.127 [ERROR] [system.err] import org.xwalk.core.XWalkGetBitmapCallback; 15:53:54.128 [ERROR] [system.err] ^ 15:53:54.128 [ERROR] [system.err] symbol: class XWalkGetBitmapCallback 15:53:54.128 [ERROR] [system.err] location: package org.xwalk.core 15:53:54.178 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkWebViewEngine. java:103: error: cannot find symbol 15:53:54.179 [ERROR] [system.err] new XWalkGetBitmapCallback() { 15:53:54.179 [ERROR] [system.err] ^ 15:53:54.180 [ERROR] [system.err] symbol: class XWalkGetBitmapCallback 15:53:54.181 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkWebViewEngine. java:207: error: cannot find symbol 15:53:54.182 [ERROR] [system.err] webView.getExtensionManager().loadExtension(XWALK_EXTENSIONS_FOLDER + File.separator + path); 15:53:54.182 [ERROR] [system.err] ^ 15:53:54.182 [ERROR] [system.err] symbol: method getExtensionManager() 15:53:54.182 [ERROR] [system.err] location: variable webView of type XWalkCordovaView 15:53:54.184 [ERROR] [system.err] /Users/or/Projects/Test/cordova/platforms/android/src/org/crosswalk/engine/XWalkCordovaView. java:93: error: method does not override or implement a method from a supertype 15:53:54.185 [ERROR] [system.err] @Override 15:53:54.185 [ERROR] [system.err] ^ 15:53:54.188 [ERROR] [system.err] Note: Some input files use or override a deprecated API. 15:53:54.188 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details. 15:53:54.188 [ERROR] [system.err] 4 errors 15:53:54.190 [ERROR] [org.gradle.BuildExceptionReporter] 15:53:54.190 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compileX86DebugJavaWithJavac'. 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] > Compilation failed; see the compiler error output for details. 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] 15:53:54.191 [ERROR] [org.gradle.BuildExceptionReporter] * Try: 15:53:54.192 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.The project is built using Android Studio.Has someone come across anything similar?Thanks 解决方案 try this it's working for me.You must add the plugin before adding the android platform.cordova -version ==> 5.1.1Navigate to the project directoryRemove the android platformCheck the crosswalk plugin is not installedAdd the crosswalk plugin with npmAdd the android platformBuild the android projectRun android project 这篇关于将Crosswalk插件添加到Cordova Android项目后生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-30 09:26