Can not invokeOperation on Android - error 1011

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I integrated my app with Fabric. It works well on iOS but on Android I got following response when invokeOperation:

errcode: 1011

errmsg: An error occurred while making the request. Please check device connectivity, server url and request parameters

httpStatusCode: 0

My device connected internet

@Megvn Reid​ Share the code snippet you have written for service integration.

Just simple code like this:

var KNYMobileFabric = new kony.sdk(); KNYMobileFabric.init(appKey, appSecret, serviceUrl, successCallback, failureCallback) ",successCallback, errorCallback);

function successCallback(res){
kony.print(“successCallback”)
fetchCats()
}

function errorCallback(res){
kony.print(“errorCallback”)
}

function fetchCats() {
var integrationClient = null;
var operationName = “Category1”;
var params = {};

var options={“httpRequestOptions”:{“timeoutIntervalForRequest”:60,
“timeoutIntervalForResource”:600}}

kony.application.showLoadingScreen(null, null, constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, {enableMenuKey:false, enableBackKey:false})

try{
integrationClient = KNYMobileFabric.getIntegrationService(SERVICE_NAME);
}
catch(exception){
kony.print(“Exception” + exception.message);
}
integrationClient.invokeOperation(operationName, null, null,
function(result) {
kony.print(“Integration Service Response is :” + JSON.stringify(result));
kony.application.dismissLoadingScreen()
}, function(error) {
kony.print(“Integration Service Failure :” + JSON.stringify(error));
kony.application.dismissLoadingScreen()
}, options);
}

iOS works well, Android doesn’t

I just found new hint:

The old service that I work and got the issue is:

https://api.bestbuy.com/v1/categories?apiKey=$apiKey

But I try with other sample api, there is no problem:

https://news.google.com/news/section?output=rss

it was strange

This issue occurs because the respective values of the timeoutIntervalForRequest and timeoutIntervalForResource properties are provided in milliseconds, instead of in seconds, in the JS file.

var options={"httpRequestOptions":{"timeoutIntervalForRequest":60,

"timeoutIntervalForResource":600}}

This issue has been fixed in 8.2.14 kony Enterprise version.

For now, you can remove these parameters and check.

It should work properly.

Thanks, you save my day ;)