Workspace ONE Android Client SDK throwing exception "empty response from airwatch mdm service"

845 views Asked by At

I have been trying to use the client SDK of Workspace ONE SDK for Android 19.6 with basic implementation

Initialization & Usage

awSDKManager = SDKManager.init(getApplicationContext());

// isEnrolled returns true 
if(awSDKManager.isEnrolled()){
   response = awSDKManager.getEnrollmentUsername();
}

Application was first uploaded on the Workspace ONE UEM portal and then side loaded on the enrolled device using Android Studio.

This isn't the only method call that fails other methods such as
device uid, camera allowed, server name, group id also throws the same exception..

Has anyone faced this issue ? Is there anything that is missing from the configuration part of the portal. I also tried to run there sample application provided in the SDK and it throws open ssl load exception android.

2

There are 2 answers

0
kanerla On

For anyone struggling with this same issue: make sure that the package of the application you downloaded to UEM portal and installed on your enrolled device has the same signature as the one you're running on the device using Android Studio. Instructions on how to do so can be found in the answers here: Android: Error - App has same packaged different signature

This should fix the issue if you have configured everything else accordingly, at least worked for me.

0
frodo2975 On

For me, a very similar error was caused by not calling init from a separate coroutine. Moving it into a "launch" fixed it:

// In MainApplication.kt

    override fun onPostCreate() {
        // Code from the application's original onCreate() would go here.

        val ctx = this
        // Launch on IO dispatcher because "init" blocks
        GlobalScope.launch(Dispatchers.IO) {
            try {
                awSdkManager = SDKManager.init(ctx)
            } catch (e: Exception) {
                Timber.e(e, "AirWatchService initSdk error")
            }
        }
    }