![](/img/trans.png)
[英]Android ProGuard warning — can't find referenced class “com.zhihu.matisse.R$plurals”
[英]Proguard Warning : com.example.android.PaymentGateway: can't find referenced field 'int container_pg' in class com.example.android.R$id
我在Android應用程序中使用proguard。 需要添加此代碼以使代碼混淆並且難以進行逆向工程。
我在導出apk時遇到此問題。 即使我使用-dontskipnonpubliclibraryclassmembers
Proguard也會低於警告。 我不確定我需要做些什么來解決這個問題。
請提前協助並表示感謝。
[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)
您編譯的類文件與庫不一致。 您可能需要重新編譯類文件,或者將庫升級到一致的版本。
[...]
如果您正在為Android開發並且ProGuard抱怨它無法找到僅在最近版本的Android運行時中可用的方法,則應更改project.properties文件或build.gradle文件中的構建目標到最近的版本。 您仍然可以在AndroidManifest.xml文件中指定不同的minSdkVersion和不同的targetSdkVersion。
如果您無法以這種方式解決它,您可以嘗試-dontwarn com.example.android.R$id
並查看您的應用程序是否運行盡管有警告,有時也是如此。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.