赞
踩
软件初次运行,发现测试类运行不成功
Executing tasks: [:app:testDebugUnitTest] in project E:\Android\MyApplications\HelloWorld > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:compileDebugAidl NO-SOURCE > Task :app:compileDebugRenderscript NO-SOURCE > Task :app:generateDebugBuildConfig > Task :app:javaPreCompileDebug > Task :app:generateDebugResValues > Task :app:generateDebugResources > Task :app:checkDebugAarMetadata > Task :app:packageDebugResources > Task :app:mergeDebugResources > Task :app:mapDebugSourceSetPaths > Task :app:createDebugCompatibleScreenManifests > Task :app:extractDeepLinksDebug > Task :app:parseDebugLocalResources > Task :app:processDebugMainManifest > Task :app:processDebugManifest > Task :app:preDebugUnitTestBuild UP-TO-DATE > Task :app:javaPreCompileDebugUnitTest > Task :app:processDebugJavaRes NO-SOURCE > Task :app:processDebugUnitTestJavaRes NO-SOURCE > Task :app:processDebugManifestForPackage > Task :app:processDebugResources > Task :app:compileDebugJavaWithJavac > Task :app:bundleDebugClassesToRuntimeJar > Task :app:bundleDebugClassesToCompileJar > Task :app:compileDebugUnitTestJavaWithJavac Could not write standard input to Gradle Test Executor 1. java.io.IOException: �ܵ����ڱ��رա� at java.base/java.io.FileOutputStream.writeBytes(Native Method) at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354) at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:68) at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61) at java.base/java.lang.Thread.run(Thread.java:829) > Task :app:testDebugUnitTest FAILED ����: �Ҳ��������������� worker.org.gradle.process.internal.worker.GradleWorkerMain ԭ��: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:testDebugUnitTest'. > Process 'Gradle Test Executor 1' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 7s 20 actionable tasks: 20 executed 10:06:40: Task execution finished ':app:testDebugUnitTest --tests "com.example.helloworld.ExampleUnitTest.addition_isCorrect"'.
此时打开File选择Settings,如下图
在Settings内搜索gradle,此时可以看到gradle的默认路径是C:\Users\sh’mi’l’y.gradle。
我们的.gradle文件路径内出现了gradle不可解析的字符 ‘’
因此,找到C:\Users\sh’mi’l’y.gradle的文件,将其复制,移动到想要的地方即可。
如果运行程序时出现E:.gradle\daemon\7.3.3\registry.bin (拒绝访问。)问题。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。