Fixed
Status Update
Comments
ch...@google.com <ch...@google.com> #2
Thanks for the report!
I found there is a typo in your configuration:
# keep names of exception classes
-keepname class * extends java.lang.Throwable
which should be "keepnames".
I found there is a typo in your configuration:
# keep names of exception classes
-keepname class * extends java.lang.Throwable
which should be "keepnames".
ga...@google.com <ga...@google.com> #3
We had a similar issue previously: issue 113122600 .
But, I'm not able to repro the error. Without correcting the typo, I got:
$ java -jar build/libs/r8.jar --pg-conf ~/Downloads/proguard-rules.pro
Error in /usr/local/google/home/jsjeon/Downloads/proguard-rules.pro at line 2, column 6:
Expected [!]interface|@interface|class|enum
Compilation failed
which looks like the correct line/column numbers now.
But, I'm not able to repro the error. Without correcting the typo, I got:
$ java -jar build/libs/r8.jar --pg-conf ~/Downloads/proguard-rules.pro
Error in /usr/local/google/home/jsjeon/Downloads/proguard-rules.pro at line 2, column 6:
Expected [!]interface|@interface|class|enum
Compilation failed
which looks like the correct line/column numbers now.
ch...@google.com <ch...@google.com> #4
Thanks!
I'm using at least two proguard files on input like
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
I will try to reproduce it on some small test project.
I'm using at least two proguard files on input like
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
I will try to reproduce it on some small test project.
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #5
One more note, after fix the typo, it crashed again on this
...\lib-about\build\intermediates\consumer_proguard_file\avastRelease\mergeAvastReleaseConsumerProguardFiles\proguard.txt:7:7: D8: Expected [!]interface|@interface|class|enum
This file looks like
1| -optimizations code/removal/simple,code/removal/advanced
2| -keepattributes SourceFile,LineNumberTable
3| -dontwarn **
4|
5| -keep class com.google.android.gms.common.GoogleApiAvailability { *; }
6| -keepname class com.actionbarsherlock.app.ActionBar
7| -keepname class com.viewpagerindicator.PagerIndicator
8| -keepname class com.nineoldandroids.view.ViewHelper
9| -keepname class com.jakewharton.disklrucache.DiskLruCache
It is the same issue.
But, again it should be line 6 instead of 7.
And also it should prefer path \lib-about\proguard-rules.pro instead of build/intermediates right?
...\lib-about\build\intermediates\consumer_proguard_file\avastRelease\mergeAvastReleaseConsumerProguardFiles\proguard.txt:7:7: D8: Expected [!]interface|@interface|class|enum
This file looks like
1| -optimizations code/removal/simple,code/removal/advanced
2| -keepattributes SourceFile,LineNumberTable
3| -dontwarn **
4|
5| -keep class com.google.android.gms.common.GoogleApiAvailability { *; }
6| -keepname class com.actionbarsherlock.app.ActionBar
7| -keepname class com.viewpagerindicator.PagerIndicator
8| -keepname class com.nineoldandroids.view.ViewHelper
9| -keepname class com.jakewharton.disklrucache.DiskLruCache
It is the same issue.
But, again it should be line 6 instead of 7.
And also it should prefer path \lib-about\proguard-rules.pro instead of build/intermediates right?
ch...@google.com <ch...@google.com> #6
It looks like for every project module declared like
implementation project(':lib-about')
it displays errors inside of build folder instead of the project file.
But in main app module, it works correctly.
implementation project(':lib-about')
it displays errors inside of build folder instead of the project file.
But in main app module, it works correctly.
ga...@google.com <ga...@google.com> #7
And also would be great if it will display something like "unknown switch xyz" instead of Expected [!]interface|@interface|class|enu ;-)
ga...@google.com <ga...@google.com>
ml...@google.com <ml...@google.com>
an...@google.com <an...@google.com> #9
Project: r8
Branch: master
commit 75bb1d807e57f28852ed972e3f3b90bdfe112340
Author: Søren Gjesse <sgjesse@google.com>
Date: Wed Jan 16 09:28:58 2019
Improve configuration parser error
If an unknown option starting with -keep if found the error will be
"Unknown option ..." and not "Expected [!]interface|@interface|class|enum".
Bug: 122823789
Change-Id: Ic18cba93b93ed44a1d02dc6760f7b25a2f8b0366
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
M src/test/java/com/android/tools/r8/TestBase.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
https://r8-review.googlesource.com/33030
Branch: master
commit 75bb1d807e57f28852ed972e3f3b90bdfe112340
Author: Søren Gjesse <sgjesse@google.com>
Date: Wed Jan 16 09:28:58 2019
Improve configuration parser error
If an unknown option starting with -keep if found the error will be
"Unknown option ..." and not "Expected [!]interface|@interface|class|enum".
Bug: 122823789
Change-Id: Ic18cba93b93ed44a1d02dc6760f7b25a2f8b0366
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
M src/test/java/com/android/tools/r8/TestBase.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
mu...@photon.com <mu...@photon.com> #10
Thanks a lot!
I tried meantime create new Android project by AS wizard, put there my proguard config file form first post, enabled R8 and changed minifyEnabled to true. And it return bad line
proguard-rules.pro:3:7: D8: Expected [!]interface|@interface|class|enum
Line 3 is empty.
The project is in the attachment. I build it just by gradlew assemble Release on Windows10
It can be caused by different EOL characters between Unix and Windows. I did not try to build the same project on some UNIX OS.
I tried meantime create new Android project by AS wizard, put there my proguard config file form first post, enabled R8 and changed minifyEnabled to true. And it return bad line
proguard-rules.pro:3:7: D8: Expected [!]interface|@interface|class|enum
Line 3 is empty.
The project is in the attachment. I build it just by gradlew assemble Release on Windows10
It can be caused by different EOL characters between Unix and Windows. I did not try to build the same project on some UNIX OS.
mu...@photon.com <mu...@photon.com> #11
Tomáš, the rule
-keepname class * extends java.lang.Throwable
with the option -keepname is still in the file. So you still get the same error. If you want to use the R8 version, where the parser error is updated add the following to you build.gradle file:
buildscript {
repositories {
maven {
url "http://storage.googleapis.com/r8-releases/raw/master " // ADD THIS.
}
}
dependencies {
classpath 'com.android.tools:r8:54b373043019b82911f22bc63f01940960f41350' // ADD THIS. Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:3.3'
}
}
-keepname class * extends java.lang.Throwable
with the option -keepname is still in the file. So you still get the same error. If you want to use the R8 version, where the parser error is updated add the following to you build.gradle file:
buildscript {
repositories {
maven {
url "
}
}
dependencies {
classpath 'com.android.tools:r8:54b373043019b82911f22bc63f01940960f41350' // ADD THIS. Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:3.3'
}
}
Description
This brought up a new window with the project, which immediately failed gradle sync with the following error:
Could not install Gradle distribution from '
Clicking on the URL in that error caused Chrome to download the file just fine, so it's not my network. Not sure what's up with Studio.
Build: AI-212.5712.43.2112.8609683, 202205181650,
AI-212.5712.43.2112.8609683, JRE 11.0.12+0-b1504.28-7817840x64 JetBrains s.r.o., OS Mac OS X(aarch64) v12.4, screens 3024.0x1964.0, 2560.0x1440.0; Retina
AS: Chipmunk | 2021.2.1 Patch 1; Kotlin plugin: 212-1.6.10-release-923-AS5457.46; Android Gradle Plugin: 7.2.1; Gradle: 7.3.3; Gradle JDK: version 11.0.12; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read