今天项目突然报错,然后用
./gradlew assembleDebug --stacktrace --debug
查看错误发现是高德地图的navi-3dmap报错,找不到对应的类,因为用到
compile 'com.amap.api:navi-3dmap:latest.integration'
就是用latest.integration来指定了最新的版本号。这里时候我想用具体的版本号来代替latest.integration,避免了更新版本,项目再次报错。
尝试了高德官网navi-3dmap版本号5.6.0,发现不行后。
下载as的ok,gradle插件。
这个插件原理是使用maven库的请求,拿到关键字后返回包含关键字的库的详细信息。
比如http://search.maven.org/solrsearch/select?q=navi-3dmap
得到最新的版本号是5.6.0_3dmap5.7.0
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"q": "navi-3dmap",
"defType": "dismax",
"indent": "off",
"spellcheck": "true",
"qf": "text^20 g^5 a^10",
"fl": "id,g,a,latestVersion,p,ec,repositoryId,text,timestamp,versionCount",
"spellcheck.count": "5",
"sort": "score desc,timestamp desc,g asc,a asc",
"version": "2.2",
"wt": "json"
}
},
"response": {
"numFound": 1,
"start": 0,
"docs": [
{
"id": "com.amap.api:navi-3dmap",
"g": "com.amap.api",
"a": "navi-3dmap",
"latestVersion": "5.6.0_3dmap5.7.0",
"repositoryId": "central",
"p": "jar",
"timestamp": 1516711304000,
"versionCount": 11,
"text": [
"com.amap.api",
"navi-3dmap",
"-sources.jar",
"-javadoc.jar",
".jar",
".pom"
],
"ec": [
"-sources.jar",
"-javadoc.jar",
".jar",
".pom"
]
}
]
},
"spellcheck": {
"suggestions": []
}
}