2017-03-08 2 views
0

マップをダウンロードすると、完了するまでに1299のリソースが必要です。しかし、アイテム数が1298/1299に達したとき。それは固まっている。基本的にそれは常に99.9%で立ち往生した。オフラインマップは表示可能で使用可能ですが、私のUIとダウンロードサービスは永久に止まってonStatusChanged()のコールバックが100%に達するのを待っています。デバッガで MapBoxはオフラインの地域が99.9%で立ち往生しました

は、私はこのログを受け付けております:

03-10 09:19:10.034 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 98.84526558891454% items 1284/1299 
03-10 09:19:10.054 23981-29834/com.indigo.android.shoreleave V/com.mapbox.mapboxsdk.http.HTTPRequest: [HTTP] Request was successful (code = 200). 
03-10 09:19:10.054 23981-29860/com.indigo.android.shoreleave V/com.mapbox.mapboxsdk.http.HTTPRequest: [HTTP] Request was successful (code = 200). 
03-10 09:19:10.064 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 98.92224788298691% items 1285/1299 
03-10 09:19:10.064 23981-29858/com.indigo.android.shoreleave V/com.mapbox.mapboxsdk.http.HTTPRequest: [HTTP] Request was successful (code = 200). 
03-10 09:19:10.074 23981-30075/com.indigo.android.shoreleave V/com.mapbox.mapboxsdk.http.HTTPRequest: [HTTP] Request was successful (code = 200). 
03-10 09:19:10.134 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 98.99923017705927% items 1286/1299 
03-10 09:19:10.154 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.07621247113164% items 1287/1299 
03-10 09:19:10.184 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.153194765204% items 1288/1299 
03-10 09:19:10.214 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.23017705927637% items 1289/1299 
03-10 09:19:10.254 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.30715935334872% items 1290/1299 
03-10 09:19:10.274 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.38414164742109% items 1291/1299 
03-10 09:19:10.304 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.46112394149345% items 1292/1299 
03-10 09:19:10.334 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.53810623556582% items 1293/1299 
03-10 09:19:10.374 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.61508852963819% items 1294/1299 
03-10 09:19:10.454 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.69207082371055% items 1295/1299 
03-10 09:19:10.484 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.7690531177829% items 1296/1299 
03-10 09:19:10.514 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.84603541185527% items 1297/1299 
03-10 09:19:10.564 23981-23981/com.indigo.android.shoreleave I/ShoreLeaveApplication: From service: Downloading id [email protected] 99.92301770592763% items 1298/1299 
03-10 09:19:20.604 23981-27396/com.indigo.android.shoreleave D/GzipRequestInterceptor: Compressing 
03-10 09:19:22.564 23981-27396/com.indigo.android.shoreleave D/MapboxEventManager: response code = 204 for events 2 

ログが長すぎるので、私は唯一の90から99.9からの私のログを取るのにです。あなたは、ログの最後から見ることができるように(99.9%で、1299分の1298)は、それは言う:これが私の最後にある場合

private OfflineManager.CreateOfflineRegionCallback mOnCreateOfflineRegionCallback = new OfflineManager.CreateOfflineRegionCallback() 
{ 
    @Override 
    public void onCreate(final OfflineRegion offlineRegion) 
    { 
     offlineRegion.setDownloadState(OfflineRegion.STATE_ACTIVE); 
     offlineRegion.setObserver(new OfflineRegion.OfflineRegionObserver() 
     { 
      @Override 
      public void onStatusChanged(OfflineRegionStatus status) 
      { 
       double percentage = status.getRequiredResourceCount() >= 0 ? (100.0 * status.getCompletedResourceCount()/status.getRequiredResourceCount()) : 0.0; 
       long mapID = offlineRegion.getID(); 

       Intent intent = new Intent(); 
       intent.putExtra(Extras.MAP_DOWNLOAD_ID, mapID); 
       intent.putExtra(Extras.DOWNLOAD_PERCENTAGE, percentage); 
       intent.putExtra(Extras.DOWNLOAD_REQUIRED_RESOURCE_COUNT, status.getRequiredResourceCount()); 
       intent.putExtra(Extras.DOWNLOAD_COMPLETED_RESOURCE_COUNT, status.getCompletedResourceCount()); 
       intent.putExtra(Extras.IS_DOWNLOAD_COMPLETE, status.isComplete()); 
       intent.putExtra(Extras.IS_DOWNLOAD_STEP_SUCCESS, true); 
       intent.putExtra(Extras.IS_DOWNLOAD_FAILED, false); 
       intent.putExtra(Extras.DOWNLOAD_STATE, status.getDownloadState()); 

       mIsFinished.put(mapID, status.isComplete()); 

       try 
       { 
        JSONObject jsonObject = new JSONObject(new String(offlineRegion.getMetadata(), Charset.forName("UTF-8"))); 
        intent.putExtra(Extras.MAP_NAME, jsonObject.getString(Extras.MAP_NAME)); 
       } 
       catch (JSONException e) 
       { 
        e.printStackTrace(); 
       } 

       ShoreLeaveCacheManager.insertOrUpdate(Utils.getDownloadStatusFromIntent(intent)); 

       createOrUpdateNotification(intent); 

       if(mOnDownloadCallback != null) 
        mOnDownloadCallback.onDownloadProgress(intent); 

       if(mIsFinished.containsKey(mapID) && mIsFinished.get(mapID)) 
        ShoreLeaveCacheManager.save(OfflineMapDownloadService.this.getApplicationContext(), ShoreLeaveCacheManager.CACHE_DOWNLOAD_STATUS); 

       if(isAllDownloadFinished()) 
       { 
        stop(); 
        mHasStarted = false; 
       } 

       Log.i(ShoreLeaveApplication.TAG, "From service: Downloading id " 
        + mapID + "@ " + percentage 
        + "% items " + status.getCompletedResourceCount() 
        + "/" + status.getRequiredResourceCount()); 
      } 

      @Override 
      public void onError(OfflineRegionError error) 
      { 
       Intent intent = new Intent(Constants.BROADCAST_OFFLINE_MAP_DOWNLOAD_STATUS); 
       intent.putExtra(Extras.MAP_DOWNLOAD_ID, offlineRegion.getID()); 
       intent.putExtra(Extras.IS_DOWNLOAD_COMPLETE, false); 
       intent.putExtra(Extras.IS_DOWNLOAD_STEP_SUCCESS, false); 
       intent.putExtra(Extras.IS_DOWNLOAD_FAILED, true); 
       intent.putExtra(Extras.DOWNLOAD_STATE, OfflineRegion.STATE_INACTIVE); 

       ShoreLeaveCacheManager.insertOrUpdate(Utils.getDownloadStatusFromIntent(intent)); 
       ShoreLeaveCacheManager.save(OfflineMapDownloadService.this.getApplicationContext(), ShoreLeaveCacheManager.CACHE_DOWNLOAD_STATUS); 
       mIsFinished.remove(offlineRegion.getID()); 
       createOrUpdateNotification(intent); 

       // LocalBroadcastManager.getInstance(OfflineMapDownloadService.this.getBaseContext()).sendBroadcast(intent); 
       if(mOnDownloadCallback != null) mOnDownloadCallback.onDownloadProgress(intent); 

       if(isAllDownloadFinished()) 
       { 
        stop(); 
        mHasStarted = false; 
       } 

       mNotificationManager.notify(1000 + ((int) offlineRegion.getID()), Utils.buildOfflineMapDownloadServiceNotification(OfflineMapDownloadService.this, intent, "Failed... ")); 
      } 

      @Override 
      public void mapboxTileCountLimitExceeded(long limit) 
      { 
       Intent intent = new Intent(Constants.BROADCAST_OFFLINE_MAP_DOWNLOAD_STATUS); 
       intent.putExtra(Extras.MAP_DOWNLOAD_ID, offlineRegion.getID()); 
       intent.putExtra(Extras.IS_DOWNLOAD_COMPLETE, false); 
       intent.putExtra(Extras.IS_DOWNLOAD_STEP_SUCCESS, false); 
       intent.putExtra(Extras.IS_DOWNLOAD_FAILED, true); 
       intent.putExtra(Extras.DOWNLOAD_STATE, OfflineRegion.STATE_INACTIVE); 

       ShoreLeaveCacheManager.insertOrUpdate(Utils.getDownloadStatusFromIntent(intent)); 
       ShoreLeaveCacheManager.save(OfflineMapDownloadService.this.getApplicationContext(), ShoreLeaveCacheManager.CACHE_DOWNLOAD_STATUS); 
       mIsFinished.remove(offlineRegion.getID()); 

       // LocalBroadcastManager.getInstance(OfflineMapDownloadService.this.getBaseContext()).sendBroadcast(intent); 
       if(mOnDownloadCallback != null) 
        mOnDownloadCallback.onDownloadProgress(intent); 

       if(isAllDownloadFinished()) 
       { 
        stop(); 
        mHasStarted = false; 
       } 

       mNotificationManager.notify(1000 + ((int) offlineRegion.getID()), Utils.buildOfflineMapDownloadServiceNotification(OfflineMapDownloadService.this, intent, "Failed... ")); 
      } 
     }); 

     if(mOnDownloadCallback != null) 
      mOnDownloadCallback.onOfflineRegionCreated(offlineRegion); 
    } 

    @Override 
    public void onError(String error) 
    { 
     // LocalBroadcastManager.getInstance(OfflineMapDownloadService.this).sendBroadcast(new Intent(Constants.BROADCAST_OFFLINE_MAP_DOWNLOAD_STATUS)); 
    } 
}; 

D/GzipRequestInterceptor: Compressing 
    03-10 09:19:22.564 23981-27396/com.indigo.android.shoreleave D/MapboxEventManager: response code = 204 for events 2 

はここに私のコードです。たぶん1つのエラーでオフになっている可能性があります。私はまだチェックしています。そうでない場合、これは正常ですか?何かご意見は?

答えて

1

これは正常ではありません。ログ出力を増やして問題を解決することができますか?

+0

こんにちは、私の編集を見てください。 –

+0

NVMでは、この質問を閉じることができます。それは1つのエラーでオフであるように見え、今修正されているようだ。 –

関連する問題