【发布时间】:2021-12-04 03:22:42
【问题描述】:
由于某种原因,当我的 android studio 找不到这个 SDK 时,这里是构建日志:
Failed to resolve: com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.0
Show in Project Structure dialog
Affected Modules: app
这是项目 build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
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'] ?: ""
}
}
}
这是模块 build.gradle:
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 30
defaultConfig {
applicationId "com.example.mapboxtest"
minSdkVersion 14
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.0'){
exclude group: 'group_name', module: 'module_name'
}
}
我对这类东西很陌生,所以如果问题就在我面前,请告诉我是什么问题。
【问题讨论】:
-
尝试删除排除组:'group_name',模块:'module_name'行...它将采用组名和模块名称值..不是这个字符串..
-
你解决了吗?
-
@KashifMehmood 没有
-
@KishanMaurya 已经试过了
-
@KashifMehmood 查看我的最新答案,这就是我想出的所有内容,并且有效
标签: android kotlin sdk dependencies mapbox