离子构建android失败 - compileDebugJavaWithJavac

时间:2016-07-13 11:37:19

标签: android cordova ionic-framework

这是我第一个使用离子1.7.16的项目。当我在我的Mac上运行 ionic build android 时,我收到以下错误。

尝试删除〜/ .cordova / lib / npm_cache,但它没有帮助

android平台目标是22

该应用程序是使用以下教程构建的,当我使用离子服务

时运行正常

在app dev期间,我运行以下命令:

ionic start ionic-maps blank
ionic setup sass
ionic platform add ios
ionic platform add android
bower install ngCordova
cordova plugin add cordova-plugin-geolocation
cordova plugin add cordova-plugin-network-information
ionic serve

离子构建android错误

    MacBook-Pro:ionic-maps XYZ$ ionic build android
Running command: /Users/XYZ/projects/madpaws/ionic/ionic-maps/hooks/after_prepare/010_add_platform_class.js /Users/XYZ/projects/madpaws/ionic/ionic-maps
add to body class: platform-android
ANDROID_HOME=/Users/XYZ/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java:222: error: cannot find symbol
        getActivity().requestPermissions(permissions, requestCode);
                     ^
  symbol:   method requestPermissions(String[],int)
  location: class Activity
/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java:228: error: cannot find symbol
        getActivity().requestPermissions(permissions, requestCode);
                     ^
  symbol:   method requestPermissions(String[],int)
  location: class Activity
/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java:233: error: cannot find symbol
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
                                                       ^
  symbol:   variable M
  location: class VERSION_CODES
/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/CordovaLib/src/org/apache/cordova/CordovaInterfaceImpl.java:235: error: cannot find symbol
            int result = activity.checkSelfPermission(permission);
                                 ^
  symbol:   method checkSelfPermission(String)
  location: variable activity of type Activity
/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java:493: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 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.779 secs
Error: Error code 1 for command: /Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/XYZ/projects/madpaws/ionic/ionic-maps/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

0 个答案:

没有答案