I'm having a hard time with dexguard to make it to do not remove a resource I access this way:
int resourceId=getResources().getIdentifier("pictures", "array", getActivity().getPackageName());
When I execute the application I get the following exception:
java.lang.RuntimeException: Unable to start activity android.content.res.Resources$NotFoundException: Array resource ID #0x0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.content.res.Resources$NotFoundException: Array resource ID #0x0
I have used this directives in proguard-project.txt extracted from some related questions on stack overflow and solved nothing:
-keepclassmembers class **.R$* {
public static <fields>;
}
-keep class **.R$*
How can I tell dexguard to do not strip out this resource?
Thanks in advance.