简体   繁体   中英

Proguard config for newrelic in android app?

I'm not using new relic in my app and it still shows class not found error. Only solution that worked for me is to include new relic. I'm using eclipse.

App works in debug, now I want to use proguard and I'm new to it. What do I need to write in proguard-project.txt to include newrelic in proguard.

Thanks!

After some testing and researching, to launch an Android app with NewRelic and have ProGuard enabled, just copy and paste the following snippet in your proguard.cfg file (or if you have yours specified as proguard-properties.txt):

-keep class com.newrelic.** { *; }
-dontwarn com.newrelic.**
-keepattributes Exceptions, Signature, InnerClasses

Source

You'll need to add the following -keep code to your proguard.cfg file (or if you have yours specified as proguard-properties.txt):

-keep public class com.newrelic.** {
public *;
private *;}

Install the agent and add that code snippet to your progaurd.cfg file.

As for the issue with non-New Relic apps throwing errors when New Relic is installed, this seems to be an issue with the build path settings in Eclipse, you can open a support ticket with us at support@newrelic.com and we can take a look at your specific environment settings, but prior cases indicate that this isn't really a New Relic-specific error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM