[英]Mapbox - FAILURE: Build failed with an exception. (Flutter)
I am using mapbox gl demo for my flutter application and getting below error at the time of running my flutter application in Android device:我正在为我的 flutter 应用程序使用 mapbox gl 演示,并且在 Android 设备中运行我的 flutter 应用程序时出现以下错误:
FAILURE: Build failed with an exception.
FAILURE:构建失败并出现异常。
- What went wrong: Execution failed for task ':app:mergeDebugAssets'.
出了什么问题:任务“:app:mergeDebugAssets”执行失败。
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
无法解析配置“:app:debugRuntimeClasspath”的所有文件。 Could not resolve com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
无法解析 com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0。 Required by: project:app > project:mapbox_gl > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0 > Could not resolve com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
要求:项目:app > 项目:mapbox_gl > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0 > 无法解析 com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0。 > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom'.
> 无法获取资源'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0。庞'。 > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom'.
> 无法获取'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom '。 Received status code 403 from server: Forbidden
从服务器收到状态码 403:Forbidden
Try: Run with --stacktrace option to get the stack trace.
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org
在https://help.gradle.org获得更多帮助
BUILD FAILED in 2m 51s [.] Gradle threw an error while downloading artifacts from the network: Retrying Gradle Build, #1: wait time.
BUILD FAILED in 2m 51s [.] Gradle 从网络下载工件时抛出错误:重试 Gradle 构建,#1:等待时间。 100ms Running Gradle task 'assembleDebug'...
100 毫秒运行 Gradle 任务“assembleDebug”...
Referring this link to integrate : https://github.com/flutter-mapbox-gl/maps#downloading-offline-regions参考此链接进行集成: https://github.com/flutter-mapbox-gl/maps#downloading-offline-regions
What might be issue?可能是什么问题? Thanks.
谢谢。
Add the following to your android/build.gradle
under section allprojects/repositories
在
allprojects/repositories
部分下将以下内容添加到您的android/build.gradle
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
Got this hint from here https://github.com/rnmapbox/maps/issues/1501#issuecomment-906158991从这里得到这个提示https://github.com/rnmapbox/maps/issues/1501#issuecomment-906158991
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.