2016-09-12 6 views
3

画像が読み込まれた後、通知を表示するために画像を同期的に読み込んでいます。 Picasso:認識できないタイプのHTTPスキーム要求

bitmap = picasso.load(imageUrl).get(); 

はそれは素晴らしい仕事をしていたが、今日、私は例外だ:私は要求ハンドラは、要求を処理することはできませんときに、このエラーはピカソによってスローされていることを理解し

Fatal Exception: java.lang.IllegalStateException: Unrecognized type of request: Request{ 
http://www.fulbori.com/mp/resources/image/19/17/e.jpg} 
     at com.squareup.picasso.BitmapHunter$2.load(BitmapHunter.java:66) 
     at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:206) 
     at com.squareup.picasso.RequestCreator.get(RequestCreator.java:396) 
     at com.jumbotail.app.utils.JtImageLoader.loadImageSync(JtImageLoader.java:397) 
     at com.jumbotail.app.notifs.JumboGcmIntentService.readInboundIntent(JumboGcmIntentService.java:213) 
     at com.jumbotail.app.notifs.JumboGcmIntentService.buildNotification(JumboGcmIntentService.java:273) 
     at com.jumbotail.app.notifs.JumboGcmIntentService.onHandleIntent(JumboGcmIntentService.java:49) 
     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 
     at android.os.Handler.dispatchMessage(Handler.java:99) 
     at android.os.Looper.loop(Looper.java:174) 
     at android.os.HandlerThread.run(HandlerThread.java:60) 

を。

次に、NetworkRequestHandlercanHandleRequest(Request data)方法(httpある)要求のUriスキームに従ってtrueに戻ってきたはずです。

しかし、すべてのリクエストハンドラは、を含むfalseを返しました。したがって、ERRORING_HANDLERがピカソによって返され、例外はIllegalStateException("Unrecognized type of request: " + request)となりました。

この例外について他の説明はありますか?

編集:ピカソにもan issueを提起しました。

+0

これはどのOSバージョンですか? – Abdellah

+0

@Abdellah、ほぼすべてのOSバージョン。通知を受けたデバイス。 –

+0

Android APIで手に入れられない23 – Abdellah

答えて

0

エラーが発生したURLがハンドラが使用できる有効なURLではないため、特にこのエラーが発生しました。特に、URL文字列の前には「http」の前にスペースがあります。

" http://example.com/image.jpg"のようになりました。

私はちょうどPicassoをロードする前に、URL文字列にtrim()を呼び出さなければならず、すごくうまくいった!

関連する問題