我有一个gradle FAILURE:

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

案例描述:

附加到项目代码库的下一个库:

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"

更新gradle-wrapper.properties distributionUrl=https....gradle-4.4-all.zip到4.7-all .zip 毕竟,gradle是建立成功的 创建测试类 @TestInstance (TestInstance.Lifecycle.PER_CLASS) 类TestClass { @Test 内部乐趣testName() { 断言。assertEquals(2,1 + 1) } } 运行测试并得到FAILURE消息。 运行Gradle构建时使用命令行参数./gradlew——warning-mode=all来查看哪些特性被弃用了。

结果,我无法构建应用程序,我得到了FAILURE:消息。


当前回答

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.

其他回答

添加实现("org.slf4j:slf4j-nop:1.7.25")到build.gradle.kts。

重要-回答工作仅对REACT-NATIVE VS CODE终端

在VisualStudio代码中,你必须像下面这样运行,然后该警告将被忽略。

React-native run-android warning-mode=all

如果你在下面运行,那么你将在终端中得到错误 当运行react-native run-android——warning-mode时,我得到错误:未知选项——warning-mode

我使用反应本机,如果以上都没有工作,删除构建和。gridle文件夹内的Android文件夹,并再次运行,这解决了我的问题

我得到了这个错误。事实证明,只有当我完全清理RN缓存(相当复杂的过程),然后创建发布构建时,才会发生这种情况。

如果我清理了缓存,创建了调试版本,然后是发布版本,那么一切都可以正常工作。有点令人担忧,但有效。

注意:我的clean命令是…

Rm -r android/build;Rm -r android/app/src/release/res;Rm -r android/app/build/intermediates;守望人守望一切;rm -rf $TMPDIR/react-*;NPM启动-- --reset-cache

下面的过程对我来说是有效的 首先检查Gradle版本:

cd android
./gradlew -v

我的情况是6.5

去https://developer.android.com/studio/releases/gradle-plugin,你会得到你的gradle版本的插件版本。对于gradle 6.5版本,插件版本为4.1.0

然后进入app/build。Gradle:<plugin_version>