在Project的build.gradle文件中配置repositories,添加mavenCentral仓库地址。Project的build.gradle文件在Project目录中位置如图所示:

配置如下:
allprojects {repositories {mavenCentral()}}
根据项目需求添加SDK依赖。引入各个SDK功能最新版本, dependencies 配置方式如下:
主工程的build.gradle文件在Project目录中位置:

以下是驾车导航组件相关依赖的示例, 配置如下:
android {defaultConfig {ndk {// 设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so)abiFilters "armeabi-v7a", "arm64-v8a"}}}dependencies {implementation 'com.baidu.lbsyun:BaiduMapSDK_Map-Navi:7.6.4'implementation 'androidx.appcompat:appcompat:1.2.0'implementation 'androidx.cardview:cardview:1.0.0'implementation 'androidx.recyclerview:recyclerview:1.2.1'implementation 'androidx.constraintlayout:constraintlayout:2.1.4'implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'implementation 'androidx.legacy:legacy-support-v4:1.0.0'implementation 'androidx.core:core-ktx:1.2.0'implementation 'com.airbnb.android:lottie:3.6.0'implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.30'implementation 'com.github.bumptech.glide:glide:4.12.0'}
上一篇
下一篇
本篇文章对您是否有帮助?