Programmers learn & share
0 votes
283 views

Problem :

I have got the following gradle FAILURE message:

..."Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0."

My Case description as follows:

·         I had attached to the project codebase the next libs:

APP/build.gradle

    //(Required) Writing and executing Unit Tests on the JUnit Platform

testImplementation "org.junit.jupiter:junit-jupiter-api:5.2.0"

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.2.0"

    // (Optional) If you need "Parameterized Tests"

testImplementation "org.junit.jupiter:junit-jupiter-params:5.2.0"

    // (Optional) If you also have JUnit 4-based tests

testImplementation "junit:junit:4.12"

testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.2.0"

testImplementation "io.mockk:mockk:1.8.5"

·         I had updated the gradle-wrapper.properties

distributionUrl=https....gradle-4.4-all.zip to 4.7-all

·         after all of that my gradle was built successfully

·         I had created the test class as follows:

@TestInstance(TestInstance.Lifecycle.PER_CLASS)

 class TestClass {

@Test

internal fun testName() {

Assert.assertEquals(2, 1 + 1)

 }

}

·         I had ran the test and got the FAILURE message as follows. 

Deprecated gradle features were used in this build, making it incompatible with gradle 5.0.

by (6.9k points)   | 283 views

1 Answer

0 votes

Solution :

 I also had the same error. I found that it was only happening when I tried to totally clean the RN caches and after that tried to create the release build.

If first I cleaned the caches and after that created a debug build and finally the  release build, then everything worked fine for me. Bit tricky but works.

Please Note: My clean command is as follows:

rm -r android/build ; rm -r android/app/src/release/res ; rm -r android/app/build/intermediates ; watchman watch-del-all ; rm -rf $TMPDIR/react-* ; npm start -- --reset-cache

by (36.1k points)  
2,245 questions
2,807 answers
60 comments
241 users