2016-03-08 153 views
3

我無法想出解決辦法,我已經嘗試過24.我的版本的SDK 20安裝經理SDK工具我不斷收到這個錯誤,當我運行離子構建Android:CordovaLib:compileDebugJavaWithJavac

ionic build android 

失敗:構建失敗,出現異常。

  • 出錯了: 任務'CordovaLib:compileDebugJavaWithJavac'的執行失敗。

    編譯失敗;詳細信息請參閱編譯器錯誤輸出。

大多數文章我已經看到了這個錯誤點更新SDK工具,是不是我的幫助。

全部輸出

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 
+0

請參閱本[鏈接](HTTP://計算器。 COM /問題/ 32557504 /離子-Android的累積誤差未能找到的,安德烈oid-home-environment-variable/32562168#32562168)它可能會幫助你 –

+0

該鏈接是關於在Ubuntu中設置離子應用程序。如果我在這篇文章中爲我的案例提供了一個相關的觀點,那就是更新npm,重新安裝JDK,Android SDK,Cordova,Ionic,我已經多次完成了這個工作,而且沒有改變錯誤。 – Dave

回答

3

嘗試:

cordova platform update android 

ionic build android 

它爲我

+0

我嘗試了其他解決方案,只有這個解決方案適用於我。謝謝! – hriziya

+0

它沒有爲我工作 – cr05s19xx