【问题标题】:How to accept Android license agreements in Visual Studio如何在 Visual Studio 中接受 Android 许可协议
【发布时间】:2017-11-08 16:13:59
【问题描述】:

我正在使用 Visual Studio Tools for Apache Cordova,最近changed the Cordova CLI version(到 6.5.0)

现在,当我尝试构建解决方案时出现错误:

You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 25].
Before building your project, you need to accept the license agreements
and complete the installation of the missing components using the Android 
Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from 
one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

有没有办法接受许可协议,而无需下载和安装 Android Studio SDK 管理器?

【问题讨论】:

    标签: android visual-studio-2015 visual-studio-cordova


    【解决方案1】:

    我在 Visual Studio 2017 中注意到输出中出现错误之前有以下几行后,能够解决此问题:

    ANDROID_HOME=C:\ProgramData\Microsoft\AndroidSDK\25
    

    然后我去复制了这个文件夹及其内容:

    C:\Program Files (x86)\Android\android-sdk\licenses
    

    转到这里使用的 Visual Studio:

    C:\ProgramData\Microsoft\AndroidSDK\25\licenses
    

    之后以下构建抱怨

    The SDK directory (C:\ProgramData\Microsoft\AndroidSDK\25) is not writeable
    

    这可以通过在 Explorer 中使其不是只读的并调整安全性然后构建来解决。

    看起来你也可以在选项菜单下更改 ANDROID_HOME 的 URL

    【讨论】:

      【解决方案2】:

      解决此问题的最简单方法是找到磁盘上的文件,例如:“C:\Program Files (x86)\Android\android-sdk”(您可以在“工具”中查看 Visual Studio 从何处获取它们 > “选项”>“Apache Cordova 工具”>“环境变量覆盖”,然后查看 ADT_HOME 中的内容)。

      从那里运行“SDK Manager.exe”,然后手动安装 API 级别 25。

      请注意,如果这不起作用或您的 SDK 太旧。您可能需要卸载 Android SDK,然后重新安装(请参阅http://taco.visualstudio.com/en-us/docs/configure-vs-tools-apache-cordova/#ThirdParty

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-03-15
        • 1970-01-01
        • 1970-01-01
        • 2018-01-03
        • 1970-01-01
        • 2021-05-18
        • 2017-07-10
        • 2020-10-12
        相关资源
        最近更新 更多