简体   繁体   中英

Proguard: Can't find referenced class jp.co.opto.opnsdk.R$string

I am running into a proguard issue.

Warning:jp.co.opto.opnsdk.BluetoothService: can't find referenced class jp.co.opto.opnsdk.R$string Warning:jp.co.opto.opnsdk.BluetoothService: can't find referenced class jp.co.opto.opnsdk.R Warning:jp.co.opto.opnsdk.Command: can't find referenced class jp.co.opto.opnsdk.R$string Warning:jp.co.opto.opnsdk.Command: can't find referenced class jp.co.opto.opnsdk.R

Below is what I have tried with no results. I believe the issue is the R. How to reference the resources to keep or dont warn?

-dontwarn jp.co.opto.opnsdk.**
-dontwarn jp.co.opto.opnsdk.BluetoothService.**
-dontwarn jp.co.opto.opnsdk.BluetoothServiceState.**
-dontwarn jp.co.opto.opnsdk.Command.**
-dontwarn jp.co.opto.opnsdk.Opn2002BluetoothService.**
-keep class jp.co.opto.opnsdk.** { *; }
-keep class jp.co.opto.opnsdk.BluetoothService.** { *; }
-keep class jp.co.opto.opnsdk.BluetoothServiceState.** { *; }
-keep class jp.co.opto.opnsdk.Command.** { *; }
-keep class jp.co.opto.opnsdk.Opn2002BluetoothService.** { *; }

Ok, I figured out the answer. I needed the -keepclassmembers .This allowed me to reduce the number of keeps and dontwarn too. For those facing a similar problem, my final code looks like this.

-keep class jp.co.opto.opnsdk.** { *; }
-dontwarn jp.co.opto.opnsdk.**
-keepclassmembers class jp.co.opto.opnsdk.** { *; }

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