0
11-21 17:26:54.852 9831-9864/? E/NETWORK: [ERROR] NETWORK - Request: https://places.hybrid.api.here.com/places/v1/meta/offline?app_id=APP_ID&app_code=APP_CODE Error: 400 Bad Request
11-21 17:26:58.097 9831-9915/? E/art: No <init>(Ljava/lang/String;)V in java.lang.Class<java.lang.AssertionError>
11-21 17:26:58.103 9831-9915/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
Process: com.zfz.fhl.heremap, PID: 9831
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: no non-static method "Ljava/lang/AssertionError;.<init>(Ljava/lang/String;)V"
at com.nokia.maps.PlacesBaseRequest.poll(Native Method)
at com.nokia.maps.PlacesBaseRequest.e(PlacesBaseRequest.java:62)
at com.nokia.maps.PlacesBaseRequest$b.a(PlacesBaseRequest.java:732)
at com.nokia.maps.PlacesBaseRequest$b.doInBackground(PlacesBaseRequest.java:713)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
這是我的主代碼:HERE地圖:java.lang.NoSuchMethodError:通過引起不非靜態方法 「Ljava /郎/ AssertionError的;. <init>(Ljava /郎/字符串;)V」
GeoCoordinate geoCoordinate = new GeoCoordinate(49.196261, -123.004773);
DiscoveryRequest request = new SearchRequest("restaurant").setSearchCenter(geoCoordinate);
ErrorCode execute = request.execute(new ResultListener<DiscoveryResultPage>() {
@Override
public void onCompleted(DiscoveryResultPage discoveryResultPage, ErrorCode errorCode) {
if (discoveryResultPage != null) {
List<DiscoveryResult> discoveryResultList = discoveryResultPage.getItems();
for (DiscoveryResult result :
discoveryResultList) {
}
}
}
});
APP_ID和App_Code文件是正確的,這是一個非常簡單的演示,其他代碼是加載地圖,之後添加這些上面的代碼,然後這個錯誤出現了,我覺得這個錯誤是由HERE地圖SDK造成的,如果任何人見過並能解決這個問題,請回覆在下面,感謝你花時間回答
_400 Bad Request_。您的請求有問題。 –
非常感謝您的回答,我之前注意到了400錯誤請求,並且可能是由400錯誤請求導致的,但是我可以在瀏覽器中訪問此URL,因此我不確定問題出在哪裏,您是否有任何問題想法或解決這個問題? – GeekFeng
我並不確定。確保您的清單符合指定的要求。 –