Proguard problem

Are there any guides or specific steps required to get Proguard working with Cocos2d-x?

I have been looking around but can’t seem to get it to work. Am I supposed to configure Proguard to keep all org.cocos2dx.lib.?
Edit:
Got it working with:
-keepclassmembers public class org.cocos2dx.lib.
{
*;
}

But is that the correct way to do it?

1 Like

I want to thank you, I released my application and it would go straight to a black screen and I found out it was caused by Proguard. After a bit of Googling I found your post and fixed my game :slight_smile:

hello Robert,

congratulations for your application and thanks for suggest about Proguard

I would like to ask you a question as you use InApp Billing

I would use Proguard in my app, I use BillingLibary from robotmedia and if I try to enable proguard in my project.properties I receive some error from robotmedia library (it seems)

I use default setting:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

I tried to enable Proguard also in BillingLibrary project but the error happens again

So I ask you, Do you use BillingLibrary by RobotMedia in your app?

How did you configure Proguard?

thanks
bye
Don

Hey Don,

Yea I used BillingLibrary from RobotMedia. Here is the Proguard config I am using. (Just remove the things you don’t need)
Hope it helps!

https://dl.dropbox.com/u/7279678/proguard-project.txt

1 Like

Hi,
Thank you very much for code i m really need it.
And guys if you want to log ndk stack remote then please go to crittercism.com

Thank you.

For cocos2d-x version 3.4, the following seemed to fix my issues:

# cocos2d-x 3.4 exceptions:
-keepclassmembers public class org.cocos2dx.lib.** {
*;
}

# more cocos2d-x 3.4 exceptions:
-keepclassmembers public class com.chukong.cocosplay.client.** {
*;
}

You can add them to your project’s local proguard file.

2 Likes