architecture-samples icon indicating copy to clipboard operation
architecture-samples copied to clipboard

Shrinker error: extraneous input '[]' expecting ')'

Open Jack-Xiao opened this issue 10 years ago • 17 comments

I download the android-architecture-todo program, and them i run it. but i got wrong, the follow is the message. I don't know how to do ? 2016-05-12 21 49 17

Jack-Xiao avatar May 12 '16 13:05 Jack-Xiao

I encountered the same problem.

foolchen avatar May 13 '16 06:05 foolchen

When I change minifyEnabled to false, the problem is solved .

foolchen avatar May 13 '16 06:05 foolchen

The problem is only hidden if you do that, and your method count will be bigger.

proguard-android.txt is the SDK's proguard file. I have not seen that error, let me investigate.

JoseAlcerreca avatar May 13 '16 09:05 JoseAlcerreca

What sample were you trying to build? I just updated todo-mvp to use the gradle plugin 2.1.0, from 2.1.0-beta3, can you try again?

JoseAlcerreca avatar May 13 '16 09:05 JoseAlcerreca

@foolchen thanks, It's work! however, what's happen. @JoseAlcerreca the project is architecture-todo base model, and solved this problem follow foolchen method.

Jack-Xiao avatar May 13 '16 10:05 Jack-Xiao

Again, disabling the minifier doesn't solve the problem.

When you say base model do you mean todo-mvp?

Can you try with 2.1.0?

JoseAlcerreca avatar May 13 '16 10:05 JoseAlcerreca

Yes, the todo-mvp,and link: https://github.com/googlesamples/android-architecture/tree/todo-mvp/ my project gradle version is also 2.1.0, and i share the problem todo-mvp project in my github :https://github.com/Jack-Xiao/todoapp

Jack-Xiao avatar May 13 '16 14:05 Jack-Xiao

Same problem here. Gradle 2.1.0 and with Android Studio 2.1.1 in Windows Try to build every official model and fail with same error

P.S. Problem only occurred after the update of May, 13th, which I believe is AS 2.1 --> 2.1.1 and support library update.

Xiadalei avatar May 14 '16 01:05 Xiadalei

@Jack-Xiao are you on Windows too?

JoseAlcerreca avatar May 14 '16 20:05 JoseAlcerreca

I've reported the problem to the build tools team.

JoseAlcerreca avatar May 14 '16 20:05 JoseAlcerreca

thanks

Jack-Xiao avatar May 14 '16 20:05 Jack-Xiao

Hi, this is Michal from the build tools team. I can't reproduce the problem, I tried git commit 10fbc69c71baa1ed8f963a68dd9f8c6fb990b12d in android-architecture, todo-mvp branch - and it built just fine. Are you using the same branch/project/commit? If not, can you post the commit number where you see the problem?

bendowski avatar May 16 '16 12:05 bendowski

These two lines in the default proguard-android.txt file are the issue:

void set*(%[]); %[] get*();;

As a quick fix this is how I made it work in the Content Providers sample:

https://github.com/googlesamples/android-architecture/blob/dev-todo-mvp-contentproviders/todoapp/app/proguard-android.txt

Basically, grabbing the default proguard-android file and adding it to the folder: https://github.com/googlesamples/android-architecture/blob/dev-todo-mvp-contentproviders/todoapp/app/build.gradle#L22

malmstein avatar May 16 '16 12:05 malmstein

@benol i also use gradle version 2.1.0. @malmstein it work with your file. It seems remove the problem getter setter method, and change Listener method? And, what happend. All of us maybe want to know.

Jack-Xiao avatar May 17 '16 02:05 Jack-Xiao

I can reproduce now, thanks. It's a known issue with the parser in 2.1, it's been fixed for 2.2.

bendowski avatar May 17 '16 12:05 bendowski

Please replace

minifyEnabled true

with

minifyEnabled false

for the debug buildType, until 2.2 is out.

JoseAlcerreca avatar May 17 '16 13:05 JoseAlcerreca

This has been fixed in the tools, we'll update all samples next week.

JoseAlcerreca avatar Jun 03 '16 17:06 JoseAlcerreca