欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

解决Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/chenqi/Library/And

程序员文章站 2022-06-06 17:39:09
...

最近更新AndroidStudio运行不起项目,新BUG,这里记录下解决方案

先看错误日志

org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/Users/chenqi/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip''
	at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:226)
	at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204)
	at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:349)
	at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:85)
	at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:745)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/chenqi/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip'
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
	at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
	at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:67)
	... 7 more
Caused by: java.io.IOException: Cannot run program "/Users/chenqi/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip" (in directory "/Users/chenqi/work/grindr/grindr-3.0-android/app"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
	... 9 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 10 more

解决Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/chenqi/Library/And

一看日志大概可以知道问题是出在NDK上,花了一点时间,最后在Stack Overflow上面找到了解决方案,

解决方案图片如下:

解决Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/chenqi/Library/And

说白了就是运行项目会去检查NDK,如果NDK没有或者有问题,就会报这个错,

这里的解决方案是不让运行项目的时候去检查NDK,所以那个NDK的勾勾去掉,保存后再运行就OK了

好了,又可以愉快玩啥了解决Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/chenqi/Library/And

相关标签: NDK