【问题标题】:Build Error with Request Location Accuracy Plugin使用请求位置准确性插件构建错误
【发布时间】:2016-02-21 07:53:18
【问题描述】:

我正在为Apache Cordova 使用Visual Studio Tools 构建Phonegap app

我正在尝试获取一个本机对话框以将用户带到/启用位置服务,同样我正在使用来自HERERequest Location Accuracy Plugin

但是,当我从 GIT 添加该插件时,我收到以下构建错误,我无法构建项目。

1>  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  A problem occurred configuring root project 'android'.
1>  > Could not resolve all dependencies for configuration ':_debugCompile'.
1>     > Could not find any version that matches com.google.android.gms:play-services-location:+.
1>       Searched in the following locations:
1>           https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml
1>           https://repo1.maven.org/maven2/com/google/android/gms/play-services-location/
1>       Required by:
1>           :android:unspecified
1>

config.xml 显示安装的插件如下声明存在于config.xml

  <plugin name="cordova-plugin-request-location-accuracy" version="1.0.1" />

任何帮助将不胜感激。

PS - 我已经在SDK Manager 中启用了Google Play 服务。

【问题讨论】:

    标签: android cordova cordova-plugins visual-studio-cordova taco


    【解决方案1】:

    我在cordova-plugin-request-location-accuracygithub repository 上提出了这个问题,Dave Alden 先生很快就回复了。他更新了项目的README

    重要提示:此插件依赖于 Google Play Services 库,因此您必须在 Android SDK Manager 的“Extras”部分下安装“Google Repository”包。否则构建将失败。

    因此,如果您尚未在 SDK 管理器的“Extras”下安装“Google Repository”,然后再次尝试构建。

    看看repository的更新文档

    【讨论】:

    • 正如我所提到的,我已经添加了 Google Play 服务。所以这不是问题。
    【解决方案2】:

    添加了另一个“EXTRA”,现在它已成功构建。看起来我们还需要添加"Android Support Repository",在最新版本的 SDK 管理器中称为"Local Maven Repository for Support Libraries"

    添加后,它运行良好,我可以完美地构建应用程序。

    【讨论】:

    • 那么我的回答有什么不同?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-16
    • 1970-01-01
    • 2012-04-05
    • 2018-09-12
    • 1970-01-01
    • 1970-01-01
    • 2020-02-25
    相关资源
    最近更新 更多