简体   繁体   English

Proguard配置为Android应用程序中的newrelic?

[英]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. 我正在使用eclipse。

App works in debug, now I want to use proguard and I'm new to it. 应用程序在调试中工作,现在我想使用proguard,我是新手。 What do I need to write in proguard-project.txt to include newrelic in proguard. 我需要在proguard-project.txt中编写什么来在proguard中包含newrelic。

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): 经过一些测试和研究,要使用NewRelic启动Android应用并启用ProGuard,只需将以下代码段复制并粘贴到proguard.cfg文件中(或者如果您将其指定为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代码添加到proguard.cfg文件中(或者如果您将其指定为proguard-properties.txt):

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

Install the agent and add that code snippet to your progaurd.cfg file. 安装代理并将该代码段添加到progaurd.cfg文件中。

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. 至于安装New Relic时非New Relic应用程序抛出错误的问题,这似乎是Eclipse中构建路径设置的问题,您可以通过support@newrelic.com与我们一起打开支持请求,我们可以采取查看您的特定环境设置,但先前的情况表明这不是一个特定于New Relic的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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