Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
je...@google.com <je...@google.com>
im...@google.com <im...@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".
da...@google.com <da...@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.
da...@google.com <da...@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.
an...@gmail.com <an...@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?
ro...@gmail.com <ro...@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.
an...@gmail.com <an...@gmail.com> #7
And also would be great if it will display something like "unknown switch xyz" instead of Expected [!]interface|@interface|class|enu ;-)
yb...@google.com <yb...@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
an...@gmail.com <an...@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.
yb...@google.com <yb...@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'
}
}
yb...@google.com <yb...@google.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
yb...@google.com <yb...@google.com> #13
That is a known issue: b/113122600 . The fix should be released in 3.5.0-alpha03.
[Deleted User] <[Deleted User]> #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
an...@gmail.com <an...@gmail.com> #16
[Deleted User] <[Deleted User]> #17
Yup, thanks.
Description
AI-192.7142.36.36.6241897, JRE 1.8.0_212-release-1586-b04x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1920x1200, 1920x1080
AS: 3.6.1; Kotlin plugin: 1.3.70-release-Studio3.6-1; Android Gradle Plugin: 3.6.1; Gradle: 5.6.4; NDK: from local.properties: (not specified), latest from SDK: 21.0.6113669; LLDB: LLDB 3.1 (revision: 3.1.4508709); CMake: from local.properties: (not specified), latest from SDK: 3.10.2, from PATH: (not found)
I have noticed that since AS 3.5.1 and it's concomitant AGP (3.5.1) projects that contain an included layout referencing a LiveData of a generic type would no longer compile.
I link here an example on GitHub:
The `master` branch uses AGP 3.5.0 and compiles and runs, the `failure` branch targets AGP 3.6.1 and fails to build.
I'm currently putting of upgrading AGP (in the affected projects) due to this issue, but I cannot do so indefinitely so if this is a permanent change then may I ask for recommended alternatives?