Fixed
Status Update
Comments
js...@google.com <js...@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".
js...@google.com <js...@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.
to...@gmail.com <to...@gmail.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.
to...@gmail.com <to...@gmail.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?
to...@gmail.com <to...@gmail.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.
to...@gmail.com <to...@gmail.com> #7
And also would be great if it will display something like "unknown switch xyz" instead of Expected [!]interface|@interface|class|enu ;-)
ap...@google.com <ap...@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
to...@gmail.com <to...@gmail.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.
sg...@google.com <sg...@google.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'
}
}
to...@gmail.com <to...@gmail.com> #12
But I'm not talking about an error. I'm talking about the wrong line a column, it reports "3:7:" but the error is on line 2
ch...@google.com <ch...@google.com> #13
That is a known issue: b/113122600 . The fix should be released in 3.5.0-alpha03.
to...@gmail.com <to...@gmail.com> #14
OK. Thanks!
js...@google.com <js...@google.com>
ap...@google.com <ap...@google.com> #15
Project: r8
Branch: d8-1.4
commit 182510fa8dd597ab4cd489db9d8ef99fb8ce3338
Author: Søren Gjesse <sgjesse@google.com>
Date: Fri Jan 18 09:46:48 2019
Version 1.4.26
Cherry-pick: Don't try to look for a class named "null" when the type name is null
CL:https://r8-review.googlesource.com/c/r8/+/33025/
Cherry-pick: Update testing framework
CL:https://r8-review.googlesource.com/c/r8/+/33027/
Cherry-pick: Improve configuration parser error
CL:https://r8-review.googlesource.com/c/r8/+/33030/
Cherry-pick: Add handling of -checkdiscard in the stand alone main dex list generator
CL:https://r8-review.googlesource.com/c/r8/+/32887/
Cherry-pick: Update tests of -checkdiscard in the standalone main dex list generator
CL:https://r8-review.googlesource.com/c/r8/+/33061/
Bug: 116774422
Bug: 122823789
Change-Id: I556173d07fbf43ed28b6345b504752f8249f6c78
M src/main/java/com/android/tools/r8/GenerateMainDexList.java
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/graph/JarCode.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
M src/main/java/com/android/tools/r8/utils/DescriptorUtils.java
A src/test/java/com/android/tools/r8/GenerateMainDexListResult.java
A src/test/java/com/android/tools/r8/GenerateMainDexListRunResult.java
A src/test/java/com/android/tools/r8/GenerateMainDexListTestBuilder.java
M src/test/java/com/android/tools/r8/TestBase.java
A src/test/java/com/android/tools/r8/TestBaseBuilder.java
A src/test/java/com/android/tools/r8/TestBaseResult.java
M src/test/java/com/android/tools/r8/TestBuilder.java
M src/test/java/com/android/tools/r8/TestCompileResult.java
M src/test/java/com/android/tools/r8/TestCompilerBuilder.java
M src/test/java/com/android/tools/r8/TestDiagnosticMessages.java
M src/test/java/com/android/tools/r8/TestDiagnosticMessagesImpl.java
M src/test/java/com/android/tools/r8/ToolHelper.java
M src/test/java/com/android/tools/r8/maindexlist/checkdiscard/MainDexListCheckDiscard.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
https://r8-review.googlesource.com/33122
Branch: d8-1.4
commit 182510fa8dd597ab4cd489db9d8ef99fb8ce3338
Author: Søren Gjesse <sgjesse@google.com>
Date: Fri Jan 18 09:46:48 2019
Version 1.4.26
Cherry-pick: Don't try to look for a class named "null" when the type name is null
CL:
Cherry-pick: Update testing framework
CL:
Cherry-pick: Improve configuration parser error
CL:
Cherry-pick: Add handling of -checkdiscard in the stand alone main dex list generator
CL:
Cherry-pick: Update tests of -checkdiscard in the standalone main dex list generator
CL:
Bug: 116774422
Bug: 122823789
Change-Id: I556173d07fbf43ed28b6345b504752f8249f6c78
M src/main/java/com/android/tools/r8/GenerateMainDexList.java
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/graph/JarCode.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
M src/main/java/com/android/tools/r8/utils/DescriptorUtils.java
A src/test/java/com/android/tools/r8/GenerateMainDexListResult.java
A src/test/java/com/android/tools/r8/GenerateMainDexListRunResult.java
A src/test/java/com/android/tools/r8/GenerateMainDexListTestBuilder.java
M src/test/java/com/android/tools/r8/TestBase.java
A src/test/java/com/android/tools/r8/TestBaseBuilder.java
A src/test/java/com/android/tools/r8/TestBaseResult.java
M src/test/java/com/android/tools/r8/TestBuilder.java
M src/test/java/com/android/tools/r8/TestCompileResult.java
M src/test/java/com/android/tools/r8/TestCompilerBuilder.java
M src/test/java/com/android/tools/r8/TestDiagnosticMessages.java
M src/test/java/com/android/tools/r8/TestDiagnosticMessagesImpl.java
M src/test/java/com/android/tools/r8/ToolHelper.java
M src/test/java/com/android/tools/r8/maindexlist/checkdiscard/MainDexListCheckDiscard.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
Description
> Task :app:transformClassesAndResourcesWithR8ForDefaultAvastRelease FAILED
R8 is an experimental feature. If you experience any issues, please file a bug at
disable R8 by updating gradle.properties with 'android.enableR8=false'.
...\app\proguard-rules.pro:3:7: D8: Expected [!]interface|@interface|class|enu
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForDefaultAvastRelease'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete
But probably location is wrong if 3:7 means line 3 and columns 7, whole line 3 is empty.
And 7th line contains just comment.
So maybe we really have a bug in our proguard config file, but R8 definitely reporting the wrong location.
I attached ...\app\proguard-rules.pro to this report.
Android Gradle Plugin: 3.3.0
Gradle: 4.10.2