Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Publish an Android App Publishing on Google Play Building a Release-Ready APK

I kept getting this error on the last step for Building a Releasse Ready APK

Error:Execution failed for task ':app:proguardRelease'.

proguard.ParseException: Expecting opening '{' at 'Log' in line 18 of file 'C:\Users\Slim Jim\AndroidStudioProjects\FunFacts\app\proguard-rules.pro'

Here is my code

FunFactsActicity Code

package com.example.slimjim.funfacts;

import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast;

import java.util.Random;

public class FunFactActivity extends Activity { public static final String TAG = FunFactActivity.class.getSimpleName(); private FactBook mFactBook= new FactBook(); private ColorWheel mColorWheel = new ColorWheel();

@Override // used to separate methods
protected void onCreate(Bundle savedInstanceState) { // void is a place holder  which let
    // let the compiler no you returning nothing
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fun_fact);


    //Declare our View Variables and assign the View label from the layout file
    final TextView factLabel = (TextView) findViewById(R.id.factTextView);
    final Button showFactButton = (Button) findViewById(R.id.showFactButton);
    final RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.relativeLayout);

    View.OnClickListener listener = new View.OnClickListener() { //listener is the variable for
        //on click lister function
        @Override // prewritten once a new variable was created for on click variable
        public void onClick(View view) {
            String fact = mFactBook.getFact();

            factLabel.setText(fact);

            int color = mColorWheel.getColor();
            relativeLayout.setBackgroundColor(color);
            showFactButton.setTextColor(color);

        }
    };// a semicolon had to be added here
    showFactButton.setOnClickListener(listener);// you had to add the declare variable here to
    //listener inside () to remove function
   // Toast.makeText(this,"Yay ! our activity was created", Toast.LENGTH_LONG).show();
     Log.d(TAG,"We are logging from the onCreat() method");

    /* make toast message long way
    String message = "Yay ! our activity was created";
    Toast welcomeToast = Toast.makeText(this,message, Toast.LENGTH_LONG);
    welcomeToast.show();
    */
}

}

proguard-rules pro code

Add project specific ProGuard rules here.

By default, the flags in this file are appended to flags specified

in C:\android-studio-bundle-windows\android-studio\sdk/tools/proguard/proguard-android.txt

You can edit the include path and order by changing the proguardFiles

directive in build.gradle.

For more details, see

http://developer.android.com/guide/developing/tools/proguard.html

Add any project specific keep options here:

If your project uses WebView with JS, uncomment the following

and specify the fully qualified class name to the JavaScript interface

class:

-keepclassmembers class fqcn.of.javascript.interface.for.webview {

public *;

}

-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 (...); }

I don't understand what wrong my code runs fine, but I kept receiving the error above so I cannot generate a sign APK