今天專案突然報錯,然後用 ./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庫的請求,拿到關鍵字後返回包含關鍵字的庫的詳細資訊。
比如search.maven.org/solrsearch/…
得到最新的版本號是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": []
}
}
複製程式碼