androidcordovaproguardcordova-plugin-proguard

Android apk release build fails with proguard


My APK builds fine in debug & release variants and installs on my test device, works as expected but when it comes to signing the APK for playstore release, it get's as far as the ProGuard part and complains about a Cordova XWalk plugin.

> ProGuard, version 5.2.1
Reading input...
Reading program jar [/home/Evil_Wizard/Projects/Taxicode/App/Android/build/intermediates/exploded-aar/org.xwalk/xwalk_core_library/14.43.343.25/jars/classes.jar] (filtered)
Reading program jar [/home/Evil_Wizard/Projects/Taxicode/App/Android/build/intermediates/exploded-aar/Android/CordovaLib/unspecified/release/jars/classes.jar] (filtered)
Reading program directory [/home/Evil_Wizard/Projects/Taxicode/App/Android/build/intermediates/classes/armv7/release] (filtered)
Reading library jar [/home/Evil_Wizard/Android/Sdk/platforms/android-21/android.jar]
Initializing...
Warning: org.apache.cordova.CordovaInterfaceImpl: can't find referenced method 'void requestPermissions(java.lang.String[],int)' in library class android.app.Activity
Warning: org.apache.cordova.CordovaInterfaceImpl: can't find referenced method 'int checkSelfPermission(java.lang.String)' in library class android.app.Activity
Note: org.chromium.base.library_loader.Linker calls '(org.chromium.base.library_loader.Linker$TestRunner)Class.forName(variable).newInstance()'
Note: org.chromium.net.DefaultAndroidKeyStore: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLRSAPrivateKey
Note: org.chromium.net.DefaultAndroidKeyStore: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLEngine
Note: org.chromium.media.MediaPlayerBridge accesses a field 'PAUSE_AVAILABLE' dynamically
Note: org.chromium.media.MediaPlayerBridge accesses a field 'SEEK_FORWARD_AVAILABLE' dynamically
Note: org.chromium.media.MediaPlayerBridge accesses a field 'SEEK_BACKWARD_AVAILABLE' dynamically
Note: the configuration keeps the entry point 'org.chromium.base.library_loader.Linker { boolean nativeLoadLibrary(java.lang.String,long,org.chromium.base.library_loader.Linker$LibInfo); }', but not the descriptor class 'org.chromium.base.library_loader.Linker$LibInfo'
Note: the configuration keeps the entry point 'org.chromium.base.library_loader.Linker { boolean nativeLoadLibraryInZipFile(java.lang.String,java.lang.String,long,org.chromium.base.library_loader.Linker$LibInfo); }', but not the descriptor class 'org.chromium.base.library_loader.Linker$LibInfo'
Note: the configuration keeps the entry point 'org.chromium.base.library_loader.Linker { boolean nativeCreateSharedRelro(java.lang.String,long,org.chromium.base.library_loader.Linker$LibInfo); }', but not the descriptor class 'org.chromium.base.library_loader.Linker$LibInfo'
Note: the configuration keeps the entry point 'org.chromium.base.library_loader.Linker { boolean nativeUseSharedRelro(java.lang.String,org.chromium.base.library_loader.Linker$LibInfo); }', but not the descriptor class 'org.chromium.base.library_loader.Linker$LibInfo'
Note: the configuration keeps the entry point 'org.chromium.content.browser.ContentViewCore { long nativeInit(org.chromium.content_public.browser.WebContents,org.chromium.ui.base.ViewAndroid,long,java.util.HashSet); }', but not the descriptor class 'org.chromium.content_public.browser.WebContents'
Note: the configuration keeps the entry point 'org.chromium.content.browser.ContentViewCore { long nativeInit(org.chromium.content_public.browser.WebContents,org.chromium.ui.base.ViewAndroid,long,java.util.HashSet); }', but not the descriptor class 'org.chromium.ui.base.ViewAndroid'
Note: the configuration keeps the entry point 'org.chromium.content.browser.ContentViewCore { org.chromium.content.browser.ContentViewCore nativeFromWebContentsAndroid(org.chromium.content_public.browser.WebContents); }', but not the descriptor class 'org.chromium.content_public.browser.WebContents'
Note: the configuration keeps the entry point 'org.chromium.content.browser.MediaDrmCredentialManager { void nativeResetCredentials(org.chromium.content.browser.MediaDrmCredentialManager$MediaDrmCredentialManagerCallback); }', but not the descriptor class 'org.chromium.content.browser.MediaDrmCredentialManager$MediaDrmCredentialManagerCallback'
Note: the configuration keeps the entry point 'org.chromium.content.browser.ServiceRegistry { void nativeAddService(long,org.chromium.mojo.bindings.Interface$Manager,org.chromium.content.browser.ServiceRegistry$ImplementationFactory,java.lang.String); }', but not the descriptor class 'org.chromium.mojo.bindings.Interface$Manager'
Note: the configuration keeps the entry point 'org.chromium.content.browser.ServiceRegistry { void nativeAddService(long,org.chromium.mojo.bindings.Interface$Manager,org.chromium.content.browser.ServiceRegistry$ImplementationFactory,java.lang.String); }', but not the descriptor class 'org.chromium.content.browser.ServiceRegistry$ImplementationFactory'
Note: the configuration keeps the entry point 'org.chromium.content.browser.framehost.NavigationControllerImpl { void nativeGetDirectedNavigationHistory(long,org.chromium.content_public.browser.NavigationHistory,boolean,int); }', but not the descriptor class 'org.chromium.content_public.browser.NavigationHistory'
Note: the configuration keeps the entry point 'org.chromium.content.browser.webcontents.WebContentsImpl { void nativeEvaluateJavaScript(long,java.lang.String,org.chromium.content_public.browser.JavaScriptCallback); }', but not the descriptor class 'org.chromium.content_public.browser.JavaScriptCallback'
Note: the configuration keeps the entry point 'org.chromium.mojo.system.impl.CoreImpl { org.chromium.mojo.system.impl.CoreImpl$AsyncWaiterCancellableImpl nativeAsyncWait(int,int,long,org.chromium.mojo.system.AsyncWaiter$Callback); }', but not the descriptor class 'org.chromium.mojo.system.AsyncWaiter$Callback'
Note: the configuration keeps the entry point 'org.xwalk.core.internal.XWalkContent { void nativeSetJavaPeers(long,org.xwalk.core.internal.XWalkContent,org.xwalk.core.internal.XWalkWebContentsDelegateAdapter,org.xwalk.core.internal.XWalkContentsClientBridge,org.xwalk.core.internal.XWalkContentsIoThreadClient,org.chromium.components.navigation_interception.InterceptNavigationDelegate); }', but not the descriptor class 'org.xwalk.core.internal.XWalkWebContentsDelegateAdapter'
Note: the configuration keeps the entry point 'org.xwalk.core.internal.XWalkContent { void nativeSetJavaPeers(long,org.xwalk.core.internal.XWalkContent,org.xwalk.core.internal.XWalkWebContentsDelegateAdapter,org.xwalk.core.internal.XWalkContentsClientBridge,org.xwalk.core.internal.XWalkContentsIoThreadClient,org.chromium.components.navigation_interception.InterceptNavigationDelegate); }', but not the descriptor class 'org.xwalk.core.internal.XWalkContentsIoThreadClient'
Note: the configuration keeps the entry point 'org.xwalk.core.internal.XWalkContent { void nativeSetJavaPeers(long,org.xwalk.core.internal.XWalkContent,org.xwalk.core.internal.XWalkWebContentsDelegateAdapter,org.xwalk.core.internal.XWalkContentsClientBridge,org.xwalk.core.internal.XWalkContentsIoThreadClient,org.chromium.components.navigation_interception.InterceptNavigationDelegate); }', but not the descriptor class 'org.chromium.components.navigation_interception.InterceptNavigationDelegate'
Note: the configuration keeps the entry point 'org.xwalk.core.internal.XWalkSettings { long nativeInit(org.chromium.content_public.browser.WebContents); }', but not the descriptor class 'org.chromium.content_public.browser.WebContents'
Note: there were 17 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').

>Note: there were 2 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.

>Note: there were 1 class casts of dynamically created class instances.
      You might consider explicitly keeping the mentioned classes and/or
      their implementations (using '-keep').

>Note: there were 3 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').

>Warning: there were 2 unresolved references to library class members.
         You probably need to update the library versions.

>Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:transformClassesAndResourcesWithProguardForArmv7Release FAILED

>FAILURE: Build failed with an exception.

>*What went wrong:

>Execution failed for task  ':transformClassesAndResourcesWithProguardForArmv7Release'.
 java.io.IOException: Please correct the above warnings first.

>*Try:
>Run with --stacktrace option to get the stack trace. Run with --info or -
debug option to get more log output.

>BUILD FAILED

>Total time: 1 mins 31.84 secs

As I am pretty new to App development, can I somehow disable the ProGuard until I know how to use / configure it? Or do I have to rebuild with a higher SDK version number somewhere one of the many places those numbers are set?


Solution

  • It was just the ProGuard minifyEnabled flag set to true causing an issue. Setting the flag to false allows for the build to be signed and released to the playstore. I'm sure I'll re-enable it once I know how to debug issues with it.

    build.gradle

    buildTypes { debug { debuggable true jniDebuggable false renderscriptDebuggable true zipAlignEnabled true } release { debuggable false jniDebuggable false renderscriptDebuggable false renderscriptOptimLevel 3 minifyEnabled false pseudoLocalesEnabled false zipAlignEnabled true } }