androidrenderscript

Proguard + RenderScript support library error


I have a project that is using the new RenderScript support library and is also using proguard for obfuscation.

Proguard was working great on the code when using the normal RenderScript SDK (android.renderscript.*). And the code is working great with the RenderScript support library when compiled in a non-release build where proguard does not run.

But, bring the two together and the result is this:

Warning: android.support.v8.renderscript.RenderScript: can't find referenced class android.os.SystemProperties
Warning: android.support.v8.renderscript.RenderScript: can't find referenced class android.os.SystemProperties
Warning: android.support.v8.renderscript.RenderScriptThunker: can't find referenced method 'android.renderscript.RenderScript create(android.content.Context,int)' in class android.renderscript.RenderScript
      You should check if you need to specify additional program jars.
Warning: there were 2 unresolved references to classes or interfaces.
         You may need to specify additional library jars (using '-libraryjars').
Warning: there were 1 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile them and try again.
         Alternatively, you may have to specify the option 
         '-dontskipnonpubliclibraryclassmembers'.

I know just enough about proguard to be dangerous. One thing I have learned is that the suggestions in the warning/error messages tend not to necessarily point at the actual cause of the issue. This time is no different: implementing the suggested changes in the warnings results in no change of the output.

Can the RenderScript support library be used with proguard? And if so, is there some magic that I need to add to my proguard config to make it work?


Solution

  • -dontwarn android.support.v8.**

    actually encountered this yesterday...