AbortException when minifyEnable=true

android

(Robert Taylor) #1

Greetings,

I have an android project where we just upgraded to gradle wrapper 4.9-all and using gradle tools plugin com.android.tools.build:gradle:3.3.0-alpha04. I have different build variants. The build types using proguard and minifyEnabled=true are failing because they can’t find the /libs folder:

Caused by: com.android.tools.r8.utils.AbortException: Error: /Users/username/projects/projectA/path-to-project/libs, java.io.FileNotFoundException:/Users/username/projects/projectA/path-to-project/libs (Is a directory)
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:116)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:74)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:119)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86)
at com.android.tools.r8.R8.run(R8.java:251)
at com.android.tools.r8.R8.run(R8.java:229)
at com.android.tools.r8.R8.lambda$run$0(R8.java:134)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:55)

If i set minifyEnabled=false, then the build completes successfully.
I have googled and haven’t found anything specific to this issue.
Please advise.


(Robert Taylor) #2

I found this to be a proguard issue. In my proguard-rules.pro i had the line

-injars libs

Commenting this out fixes the issue.
If i specify the file explicitly, like:

injars libs/mytools.jar

then, i get a message like

Error: Program type already present: com.mydomain.package.someclass

Has anyone else run into this issue?