androidazureazure-devopsazure-cognitive-servicesminix

Microsoft Azure hostname didn't match


I am using Microsoft Azure Face to get the data from an image in an Android Application running in an android box (minix), when I reach the point in the code where I send the image to receive this data I get the following error:

Detection failed: hostname in certificate didn't match: != <.cognitiveservices.azure.com> OR <.cognitiveservices.azure.com>

I don't know what this error means because I am not using the certificates. The base code I am using is the one from the original repository:

https://github.com/Azure-Samples/cognitive-services-face-android-detect

Note: If i run this code in an Android mobile it works correctly but the objective is to make it work in the android box (minix).

Note2: I have a valid suscription key.

Any help will be appreciated, thanks.


Solution

  • I solved this a few months ago so I'm posting the solution I found.

    The problem was due to "okhttp" library, after talking with the Azure developers they told me to update the version to "1.4.4" from "1.4.3". After that I had a problem with the said library "okhttp":

    Failed to transform file 'okhttp-3.13.1.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=15} using transform DexingTransform Error while dexing.

    I also solved this problem following JakeWharton's answer in this post from github

    https://github.com/square/okhttp/issues/4597

    So I had to add the following lines in my application "build.gradle" :

     compileOptions {
            targetCompatibility = "8"
            sourceCompatibility = "8"
        }
    

    I hope this helps someone with the same situation as me.