简体   繁体   English

Proguard警告:com.example.android.PaymentGateway:在类com.example.android.R $ id中找不到引用字段'int container_pg'

[英]Proguard Warning : com.example.android.PaymentGateway: can't find referenced field 'int container_pg' in class com.example.android.R$id

I am using proguard in android app. 我在Android应用程序中使用proguard。 It is required to add this to make code obfuscated and difficult to do reverse engineering. 需要添加此代码以使代码混淆并且难以进行逆向工程。

I am getting this problem while export the apk. 我在导出apk时遇到此问题。 Proguard throws below warning even I use the -dontskipnonpubliclibraryclassmembers . 即使我使用-dontskipnonpubliclibraryclassmembers Proguard也会低于警告。 I am not sure what additional things I need to do to resolve this. 我不确定我需要做些什么来解决这个问题。

Please assist and thanks in advance. 请提前协助并表示感谢。

[2014-08-14 15:48:28 - ] Warning: com.example.android.PaymentGateway: can't find referenced field 'int container_pg' in class com.example.android.R$id
[2014-08-14 15:48:28 - ] Warning: com.example.android.PaymentGateway$RetrieveEncKey: can't find referenced field 'int container_pg' in class com.example.android.R$id
[2014-08-14 15:48:28 - ]       You should check if you need to specify additional program jars.
[2014-08-14 15:48:28 - ] Warning: there were 2 unresolved references to program class members.
[2014-08-14 15:48:28 - ]          Your input classes appear to be inconsistent.
[2014-08-14 15:48:28 - ]          You may need to recompile them and try again.
[2014-08-14 15:48:28 - ]          Alternatively, you may have to specify the option 
[2014-08-14 15:48:28 - ]          '-dontskipnonpubliclibraryclassmembers'.
[2014-08-14 15:48:28 - ] java.io.IOException: Please correct the above warnings first.
[2014-08-14 15:48:28 - ]    at proguard.Initializer.execute(Initializer.java:321)
[2014-08-14 15:48:28 - ]    at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-08-14 15:48:28 - ]    at proguard.ProGuard.execute(ProGuard.java:86)
[2014-08-14 15:48:28 - ]    at proguard.ProGuard.main(ProGuard.java:492)

From the Proguard troubleshooting guide : Proguard故障排除指南

Your compiled class files are inconsistent with the libraries. 您编译的类文件与库不一致。 You may need to recompile the class files, or otherwise upgrade the libraries to consistent versions. 您可能需要重新编译类文件,或者将库升级到一致的版本。

[...] [...]

If you're developing for Android and ProGuard complains that it can't find a method that is only available in a recent version of the Android run-time, you should change the build target in your project.properties file or build.gradle file to that recent version. 如果您正在为Android开发并且ProGuard抱怨它无法找到仅在最近版本的Android运行时中可用的方法,则应更改project.properties文件或build.gradle文件中的构建目标到最近的版本。 You can still specify a different minSdkVersion and a different targetSdkVersion in your AndroidManifest.xml file. 您仍然可以在AndroidManifest.xml文件中指定不同的minSdkVersion和不同的targetSdkVersion。

If you can't resolve it that way, you can try -dontwarn com.example.android.R$id and see if your application runs despite the warnings, which is sometimes the case. 如果您无法以这种方式解决它,您可以尝试-dontwarn com.example.android.R$id并查看您的应用程序是否运行尽管有警告,有时也是如此。

暂无
暂无

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

相关问题 Android ProGuard警告-找不到引用的类“ com.zhihu.matisse.R $ plurals” - Android ProGuard warning — can't find referenced class “com.zhihu.matisse.R$plurals” java.lang.NoClassDefFoundError:com.example.android.R $ drawable - java.lang.NoClassDefFoundError: com.example.android.R$drawable ProGuard:找不到引用的类com.google.android.gms.R - ProGuard: can't find referenced class com.google.android.gms.R 警告:com.qoppa.viewer.bh:找不到引用的类android.graphics.PixelXorXfermode - Warning:com.qoppa.viewer.b.h: can't find referenced class android.graphics.PixelXorXfermode Android ProGuard:找不到引用的类 - Android ProGuard: can't find referenced class Proguard android找不到引用的类 - Proguard android can't find referenced class 如何在Android Eclipse ProGuard规则中修复警告“无法找到引用的类”? - How to fix warning 'can't find referenced class' in Android Eclipse ProGuard Rule? Android警告:com.bbn.openmap.MapBean:找不到引用的类java.awt.geom.Point2D - Android Warning: com.bbn.openmap.MapBean: can't find referenced class java.awt.geom.Point2D 签名apk错误:proguard在com.firebaseui之后找不到引用类android.arch.core.util.Function:firebase-ui-database update to 2.3.0 - Signed apk error: proguard can't find referenced class android.arch.core.util.Function after com.firebaseui:firebase-ui-database update to 2.3.0 警告:在库类android.graphics.Canvas中找不到引用的方法'int save(int)' - Warning: can't find referenced method 'int save(int)' in library class android.graphics.Canvas
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM