Backendless Warning in Android using Proguard.

Hello,

I am using Proguard in Android and I have added below rules for Backendless-
-dontwarn com.backendless.**
-dontwarn weborb.**
-keep class weborb.** {;}
-keep class com.backendless.** {
;}

But while creating release apk, I am getting below warning-

Warning:com.repairservice.ActivationActivity$2$1: can’t find enclosing method ‘void handleResponse(com.backendless.messaging.MessageStatus)’ in program class com.ketan.repairservice.ActivationActivity$2

Any idea on whats that error means?

Hello,

What version of Backendless SDK do you use in the project?

Regards,
Mark

I’m using Backendless v4

I have defined AsyncCallback instance in my class, if I do comment it then release apk is built.

Is there a method in the class you are getting the warning about?

Nope

I’m having below code in my class-
AsyncCallback<List<ServiceOrder>> serviceOrderCallback = new AsyncCallback<List<ServiceOrder>>() {
@Override
public void handleResponse(List<ServiceOrder> response) {

}

@Override
public void handleFault(BackendlessFault fault) {

}

};
if I do comment above code then the release apk is built successfully.

I do not understand where a reference to “void handleResponse(com.backendless.messaging.MessageStatus)” is coming from. Why does it refer to a callback with MessageStatus? Do you have any ideas?

I don’t know Mark, Do u need any other info? Have u tried defining AsyncCallback instance in class and creating a release build with proguard-rules?

I do not believe the problem is with Backendless. Does it compile if you remove the Proguard settings?

I am able to run my app in debug mode but while creating release build it give the warning -

Warning:com.ketan.repairservice.ActivationActivity$2$1: can’t find enclosing method ‘void handleResponse(com.backendless.messaging.MessageStatus)’ in program class com.ketan.repairservice.ActivationActivity$2

Try excluding from obfuscation the class(es) which generate the warning.

I’m not sure what the problem is but I managed it by specifying the AsyncCallback instance in method find(query, asyncCallback) itself.