gpt4 book ai didi

android - 我如何在 Android Studio 中添加依赖项

转载 作者:行者123 更新时间:2023-11-29 14:44:45 24 4
gpt4 key购买 nike

我想将此依赖项 compile 'com.github.ar-android:DrawRouteMaps:1.0.0' 添加到我的 Android studio 项目中。
将其添加到依赖项并单击“同步”时,会显示此错误:

Error:(39, 13) Failed to resolve: com.github.ar-android:DrawRouteMaps:1.0.0
<a href="openFile:G:/Android/Projects/1-MapTutorial/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

build.gradle 代码:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'

defaultConfig {
applicationId "com.example.mohammadn.a1_maptutorial"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
mavenCentral()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.android.gms:play-services-maps:9.2.1'
testCompile 'junit:junit:4.12'

compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'

compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
}

如何修复它并将此库添加到我的依赖项中?

最佳答案

在存储库末尾的根 build.gradle 中添加支持 jitpact 存储库:

    allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}

阅读有关的官方指南DrawRouteMaps .

关于android - 我如何在 Android Studio 中添加依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43451657/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com