【发布时间】:2020-11-06 23:49:06
【问题描述】:
如果我错了,请纠正我。 我正在使用 mapbox api 专门用于导航,现在我很困惑并停止了,因为我无法导入 API。我已经关注了 Mapbox 本身的文档,但我仍然不能。对不起我的英语不好,我还在学习:)
这是我的 build.gradle(app)
应用插件:'com.android.application' 应用插件:'kotlin-android' 应用插件:'kotlin-android-extensions' 安卓 { compileSdkVersion 30 buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.kks.treking"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
maven { url 'https://mapbox.bintray.com/mapbox' }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
依赖{ 实现 fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//Google Authentication
implementation 'com.google.firebase:firebase-auth:19.3.1'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
//Mapbox
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0') {
exclude group: 'group_name', module: 'module_name'
}
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.1.0'
implementation "com.mapbox.navigation:ui:1.1.0"
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.android.material:material:1.3.0-alpha03'
//noinspection GradleDependency
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"}
我得到了这个错误: 无法获取“https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/navigation/ui/1.1.0/ui-1.1.0.pom”。从服务器收到状态码 403:Forbidden 禁用 Gradle 的“离线模式”并同步项目
【问题讨论】:
标签: android android-studio mapbox mapbox-android