我正尝试使用Retrofit向Google GeoCode API发送请求。 服务接口如下所示: public interface FooService { @GET("/maps/api/geocode/json?address={zipcode}&sensor=false") void getPositionByZip(@Path("zipcode") int zipcode, Callback<String> cb); } 当我致电服务时: OkHttpClient okHttpClient = new OkHttpClient(); RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(Constants.GOOGLE_GEOCODE_URL).setClient(new OkClient(okHttpClient)).build(); FooService service = restAdapter.create(FooService.class); service.getPositionByZip(zipCode, new Callback<String>() { @Override public void success(String jsonResponse, Response response) { … } @Override public void failure(RetrofitError retrofitError) { } }); 我收到以下堆栈跟踪: […]