Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 359 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0

#1
I've got a gradle FAILURE:

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

Case description:

- 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"

- Updated the **gradle-wrapper.properties**

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


- after all of that gradle was built success

- created the test calss

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TestClass {

@Test
internal fun testName() {
Assert.assertEquals(2, 1 + 1)
}
}


- ran the test and got the FAILURE message.
[![enter image description here][1]][1]


- ran the Gradle build with a command line argument `./gradlew --warning-mode=all` to see what exactly the deprecated features are.
[![enter image description here][2]][2]

As a result I couldn't build the app and I've got that FAILURE: message.


[1]:

[2]:
Reply

#2
Finally decided to downgrade the junit 5 to junit 4 and rebuild the testing environment.
Reply

#3
Set distributionUrl path in gradle-wrapper-properties files as :

**distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip**
Reply

#4
Update your third party dependencies. *for example* I updated dependency from
`implementation 'com.github.ybq:Android-SpinKit:1.1.0'` to `implementation 'com.github.ybq:Android-SpinKit:1.2.0'`. and in my case issue has been solved.
Reply

#5
I was getting this error. Turns out it only happened when I completely cleaned the RN caches (quite elaborate process) and then created a release build.

If I cleaned the caches, created a debug build and then a release build, everything worked. Bit worrying but works.



*Note: My clean command is...*

```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```
Reply

#6
Run the Gradle build with a command line argument `--warning-mode=all` to see what exactly the deprecated features are.

It will give you a detailed description of found issues with links to the Gradle docs for instructions how to fix your build.

Adding `--stacktrace` to that, you will also be able to pinpoint where the warning comes from, if it's triggered by outdated code in one of the plugins and not your build script.
Reply

#7
**Important - Answer work only for REACT-NATIVE VS CODE Terminal**

In VisualStudio code, you have to run like below then that warning will be omitted.

**react-native run-android warning-mode=all**

> If you run below then you will get the error in terminal
When running react-native run-android --warning-mode all I get error: unknown option --warning-mode'



Reply

#8
Solution for the issue:
deprecated gradle features were used in this build making it incompatible with gradle 6.0. android studio
This provided solution worked for me.

First change the classpath in dependencies of build.gradle of your project
From: `classpath 'com.android.tools.build:gradle:3.3.1'`
To: `classpath 'com.android.tools.build:gradle:3.6.1'`

Then make changes in the gradle-wrapper.properties file this file exists in the Project's gradle>wrapper folder
From: `distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip`
To: `distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip`

Then Sync your gradle.
Reply

#9
Try this one

cd android && ./gradlew clean && ./gradlew :app:bundleRelease
Reply

#10
On a SpringBoot project using IntelliJ and Gradle, I got the warning "Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0" when running my integration test.
What solved the problem was:
- Going to: File > Settings > Build, Execution, Deployment
- Selecting for "Build and run using": Intellij IDEA (instead of "Gradle")
- Same for "Run tests using"
That did not explain why Gradle is displaying the warning, but that let me perform the test and progress in my work.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through