0

After updating my android studio to 3.1.1 I found the error in the picture. Before I updated android studio everything was fine.

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;


public class SetTimeActivity extends AppCompatActivity  {
    private  int TIME_IN_MINUTES ;
    private EditText et ;
    private Button mButtonStartPause;
    private Button mButtonReset;
    private CountDownTimer mCountDownTimer;
    private boolean mTimerRunning;
    private long mTimeLeftInMillis;
    private long mEndTime;
    DevicePolicyManager devicePolicyManager;
    ComponentName componentName;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set_time);
        et = (EditText) findViewById(R.id.setTimerMenu_et);
        mButtonStartPause = (Button) findViewById(R.id.set_btn);
        devicePolicyManager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
        componentName = new ComponentName(SetTimeActivity.this, Controller.class);

enter image description here

Michael Dodd
  • 10,102
  • 12
  • 51
  • 64

2 Answers2

1

Try the following and check if it works :

  1. Try to invalidate caches and restart. For this :

File -> Invalidate Caches and Restart

  1. Open up your command line and perform a manual gradle build :

    ./gradlew clean assemble

  2. Make sure you have the following in your build.gradle :

    compile "com.android.support:appcompat-v7:{latest}"
    
0

Thank you for your answer but I got it Now, So they add dependencies to the gradle and we have to replace "compile" with "implementation", something like this , you can find everything you need in this URL :

https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html?utm_source=android-studio#new_configurations