I've updated Android Studio and now I see errors that were not there before

1

Well, that worked perfectly ... I updated the Android Studio and now it does not work.

I see errors in build, Run tasks .. and I have no idea what it is or how to solve it

This is an image of what I see

I also see that in one of my Activitys I get the "R" in red, here:

import static com.android.rodry.chistes.R.id.activity_showchistes;

here:

setContentView(R.layout.activity_showchistes);

and here:

textView.setBackgroundColor(getResources().getColor(R.color.BrackgroundChistes));

I also see some Warnings on the Sync tab:

My build.gradle dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support:appcompat-v7:24.2.1'
    testImplementation 'junit:junit:4.12'
}

    
asked by Rodrypaladin 11.11.2018 в 18:05
source

2 answers

2

Go to

Go to

and Change compile to implementation

and press

I know what it is because your image is clearly compiled in orange with stripes which means deprecated.

besides that it indicates

If you keep marking error replace what your image indicates TestCompile by Testimplementation etc

    
answered by 11.11.2018 в 18:16
2

First it is important to change in your build.grade the use of

  • compile by implementation

  • testCompile by testImplementation

  • androidTestCompile by androidTestImplementation

since its use is obsolete to define dependencies, since the version of Gradle using Android Studio was also updated, this must be changed within the block dependencies , example:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

since it is the main problem indicated in the console:

When you make this change, simply synchronize the build.gradle file with your project again using the "Sync Now" option:

* important to update your Android SDK Build Tools to version 28.0.3 as a minimum since it is the minimum version supported by Android Gradle Plugin 3.2.1 .

Change:

buildToolsVersion '24.0.2'

a:

buildToolsVersion '28.0.3'
    
answered by 11.11.2018 в 18:18