Backendless Support
 
Answered

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?

Leave a Comment

Comments (12)

photo
1

Hello,

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

Regards,

Mark

photo
1

I'm using Backendless v4

photo
photo
1

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

photo
1

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

photo
1

Nope

photo
1

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.

photo
1

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?

photo
1

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?

photo
1

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

photo
1

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

photo
1

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

photo
1

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

photo