Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Publish an Android App Publishing on Google Play Removing Log Calls

Big Group
Big Group
16,464 Points

Error in 'proguard-rules.pro' file after pasting in code.

Hi,

I've put the code to remove log calls into the proguard-rules file and I've got an error appearing at the end of my file (next to the '}' character), saying:

'ProguardTokenType.CRLF expected, unexpected end of file'

Any ideas why this might be?

Thanks!

I think you might have done something wrong when you did the copy paste. I suggest you recheck the code. If that doesn't fix it and you are using an older version (< 0.8.3) of android studio then that might be a previous bug: https://android-review.googlesource.com/#/c/96030/ that is now fixed on the new updates, so updating it might resolve it.

These are the two suggestions I have.

How can I update android studio? I downloaded the version from Treehouse. It looks like it is 8.2. I am also having an error when entering in the pasted code.

ameydharden - I just saw your question. I hope you have sorted it out by now.

I have the same problem error: 'ProguardTokenType.CRLF expected, unexpected end of file'. I copied this text from the teacher's notes:

-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}

And the error pops right after the to the '}' character that ends the block.

I downloaded the android studio that was given my treehouse, (0.82)

4 Answers

Fabrice Cochet
Fabrice Cochet
1,035 Points

Yes,

I think that code in file proguard-rules.pro is too strict.

I tried

<p>-assumenosideeffects class android.util.Log
{
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}</p>

instead of

<p>-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}</p>

and I had an error

Note : How can we add bbcode in order to say that a part is a piece of code ?

On the Markdowm Cheatsheet it says... "Code Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

        ```html
        <p>This is code!</p>
        ```"

Also...I think you have pasted the same code twice. The only difference is the white spaces. Maybe you did that by mistake?

Fabrice Cochet
Fabrice Cochet
1,035 Points

Thanks gloria !

It works.

I didn't see the note "Reference this Markdown Cheatsheet for syntax examples for formatting your post. " (^_^)

No worries :D You are welcome Fabrice!

Fabrice Cochet
Fabrice Cochet
1,035 Points

No i didn't make a error.

I know that the only difference is the open brace on a new line or at the end line.

In the case of a brace on new line, there is an error notified by "Android Studio" even if the compilation is OK

It's for this reason that I wrote Android Studio is too strict.

Oh okay. I never faced that issue. That's interesting.

Robert DeFilippi
Robert DeFilippi
734 Points

Humm...after reading about this problem (which I also had) I updated to Android Studio 9.x from 8.2. However now AS is asking me for my SDK location. Is this new with 9.x or did I miss something :/