简体   繁体   中英

Android Studio Proguard fail to run

In my proguard-project.txt file I have this line:

-injars      libs

When i try to create Signed APK i get this error:

Unexpected input type. Only archive types are supported, e.g., .jar, .zip, etc.

Any idea what is the issue?

I also faced same issue but after removing -injars libs -outjars bin/classes-processed.jar from proguard-rule.pro its wokring fine. But still i am trying to understand the reason.

For your reference: https://r8.googlesource.com/r8/+/master/src/main/java/com/android/tools/r8/utils/AndroidApp.java

OK. After some researching, I found out that downgrade Android Studio from 3.5 to 3.3 fixes my problem.

Hope it will help!

If we are using Gradle plugin 3.4.0*, R8 is the default compiler its the combination of proguard and D8 compiler, so 3.4.0* is better for build process.

As i understand if we use R8 it will generate some progaurd rules automatically and its will not support few lines in progaurd file like injars,outjars etc... That's why its throwing exception like

Unexpected input type. Only archive types are supported, eg, .jar, .zip, etc.

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