【问题标题】:Ionic Cordova android build failedIonic Cordova android 构建失败
【发布时间】:2018-03-05 10:08:27
【问题描述】:

我在构建项目的 android 部分时出错。

1>MSBUILD : cordova-build error : Error: cmd: Command failed with exit code 1 Error output:
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>MSBUILD : cordova-build error : * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Failed to install the following SDK components:
1>MSBUILD : cordova-build error :  [Android SDK Platform 26]
1>MSBUILD : cordova-build error :  The SDK directory (C:\ProgramData\Microsoft\AndroidSDK\25) is not writeable,
1>MSBUILD : cordova-build error :  please update the directory permissions.

我已经安装了 Android SDK Platform 26,但安装在不同的位置。 (C:\Program Files (x86)\Android\android-sdk)

但是cordova访问不同的目录(C:\ProgramData\Microsoft\AndroidSDK\25)

我在想,如何更改 Ionic 的 SDK 路径?或者我如何授予 Ionic 在特定文件夹上写入的权限?谢谢!

PS:系统信息

Visual Studio 2017 Version 15.5.7
Cordova-Android: 6.2.3
Cordova: 8.0.0
Gradle: 4.6

【问题讨论】:

    标签: android cordova ionic-framework ionic3


    【解决方案1】:

    您可以尝试将环境变量 ANDROID_HOME 设置为终端中的正确目录

        set ANDROID_HOME=C:\<installation location>\
        set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-01
      • 2019-09-25
      • 2018-06-07
      • 2021-02-27
      • 2019-11-01
      • 1970-01-01
      • 2018-10-07
      • 1970-01-01
      相关资源
      最近更新 更多