Custom Vision Prediction call error via Java SDK on Android studio - "Unable to Resolve Host"

Ashfak Ifham 1 Reputation point

Service: - Azure Custom Vision prediction service from android studio
Documentation link -

While using the java version of the SDK, and following the instructions on the documentation, Im not able to query a prediction service due to below error :
Unable to resolve host ""
I have initiated the instances as required and the system has them active in the runtime. The attached images would provide further insight on to how I have called the prediction service, how the objects have been initiated and available at the runtime, and the subsequent error after it.

The prediction call is as done on the documentation and Im not able to zero in on the root cause of the matter. Please share some insights.

Attached images for your reference.127009-debug-mode-initated-data.png127010-prediction-endpoint-error.png127028-customvision-prediction-call.png

Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
231 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,526 Reputation points Microsoft Employee

    @Ashfak Ifham I think the issue is you are trying to use the endpoint provided on Azure portal for a custom vision resource as the prediction endpoint. This is partly true because the key to your prediction endpoint request is the key of this resource. But, the endpoint is dependent on region in which your resource is created along with the project id and the iteration number which is actually published to this prediction resource.

    A very simple way to get the prediction endpoint is to create it following the below convention for a image URL or a image file respectively:


    You can also lookup the prediction endpoint from Azure custom vision portal from the predictions tab for the published iteration: