离子构建android:CordovaLib:compileDebugJavaWithJavac [英] ionic build android :CordovaLib:compileDebugJavaWithJavac
本文介绍了离子构建android:CordovaLib:compileDebugJavaWithJavac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法解决这个问题,我尝试在我的SDK管理器中为20到24版本安装SDK工具。当我运行时,我一直收到这个错误
ionic build android
$ b FAILURE:构建失败,出现异常。 / b>
执行任务':CordovaLib:compileDebugJavaWithJavac'失败。
编译失败;详细信息见编译器错误输出。
错误指向更新不支持我的SDK工具。
完整输出
Daves-MacBook-Pro:App dvero $ ionic build android
运行命令:/Users/dvero/App/hooks/before_prepare/011_readonly.js
/ Users / dvero / App
4.0.0
运行命令:/Users/dvero/App/hooks/after_prepare/010_add_platform_class.js
/ Users / dvero / App
添加到body类:platform-android
ANDROID_HOME = / Users / dvero / Library / Android / sdk
JAVA_HOME = / Library / Java / JavaVirtualMachines / jdk1.7.0_80.jdk / Contents / Home
运行:/ Users / dvero / App / platforms / android / gradlew cdvBuildDebug -b
/Users/dvero/App/platforms/android/build.gradle -Dorg.gradle.daemon = true
嵌入式
org.xwalk:xwalk_core_library:16+
:copyCSSFiles
:copyIMGFiles
:copyJSFiles
:fixReferences UP-TO-DATE
:preBuild
:preArmv7DebugBuild
:checkArmv7DebugManifest
:preX86DebugBuild
:CordovaLib :compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP- TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
: CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO- DATE
:CordovaLib:compileDebugJavaWithJavac / Users / dvero / App / platforms / android / CordovaLib / src / org / apache / cordova / ResumeCallback.java:42:error:finished在CallbackContext中有私人存取
if完成){
^
/用户/ dvero / App / platforms / android / CordovaLib / src / org / apache / cordova / ResumeCallback.java:46:错误:已在CallbackContext中完成私人存取
已完成= true;
^
/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:74:error:can not find symbol
appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK,result));
^
符号:方法sendResumeEvent(PluginResult)
位置:CoreAndroid类型的变量appPlugin
注意:某些输入文件使用或覆盖弃用的API。
注意:使用-Xlint:deprecation重新编译以获取详细信息。
3错误
失败
失败:构建失败,出现异常。
*出错:
任务'CordovaLib:compileDebugJavaWithJavac'执行失败。
>编译失败;详细信息请参阅编译器错误输出。
*尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或 - debug选项运行以获取更多日志输出。
构建失败
总时间:3.126秒
构建其中一个平台的错误:命令错误代码1:/ Users / dvero / App / platforms / android / gradlew with args:cdvBuildDebug,-b,/ Users / dvero / App / platforms / android / build.gradle,-Dorg.gradle.daemon = true
您可能没有所需的环境或操作系统来编译此项目
错误:命令错误代码1:/ Users / dvero / App / platforms / android / gradlew with args:cdvBuildDebug,-b,/ Users / dvero / App / platforms / android / build.gradle,-Dorg。 gradle.daemon = true
解决方案
cordova平台更新android
和之后
ionic build android
它对我有用
I am unable to figure this out, I have tried installing SDK tools in my SDK manager for versions 20 through 24. I keep getting this error when I run
ionic build android
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Most articles I have seen with this error points to updating SDK tools which is not helping me.
Full output
Daves-MacBook-Pro:App dvero$ ionic build android
Running command: /Users/dvero/App/hooks/before_prepare/011_readonly.js
/Users/dvero/App
4.0.0
Running command:/Users/dvero/App/hooks/after_prepare/010_add_platform_class.js
/Users/dvero/App
add to body class: platform-android
ANDROID_HOME=/Users/dvero/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Running: /Users/dvero/App/platforms/android/gradlew cdvBuildDebug -b
/Users/dvero/App/platforms/android/build.gradle -Dorg.gradle.daemon=true
embedded
org.xwalk:xwalk_core_library:16+
:copyCSSFiles
:copyIMGFiles
:copyJSFiles
:fixReferences UP-TO-DATE
:preBuild
:preArmv7DebugBuild
:checkArmv7DebugManifest
:preX86DebugBuild
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:42: error: finished has private access in CallbackContext
if (finished) {
^
/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:46: error: finished has private access in CallbackContext
finished = true;
^
/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:74: error: cannot find symbol
appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, result));
^
symbol: method sendResumeEvent(PluginResult)
location: variable appPlugin of type CoreAndroid
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib: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.
BUILD FAILED
Total time: 3.126 secs
ERROR building one of the platforms: Error code 1 for command: /Users/dvero/App/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/dvero/App/platforms/android/build.gradle,-Dorg.gradle.daemon=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /Users/dvero/App/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/dvero/App/platforms/android/build.gradle,-Dorg.gradle.daemon=true
解决方案
Try:
cordova platform update android
and after
ionic build android
It worked for me
这篇关于离子构建android:CordovaLib:compileDebugJavaWithJavac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文