RenderScript在macOS Catalina(10.15)上损坏


9

我已经更新到MacOS Catalina。今天早上,当我在做Android项目时,它突然开始出现以下异常:“错误:原因:错误= 86,可执行文件中的CPU类型错误”。

我怀疑是因为我更新到了macOS 10.15,并且因为我尝试为我的项目构建APK(因此它重新构建了renderscript的东西)。这是给定的完整堆栈跟踪:

org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld''
    at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:232)
    at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:209)
    at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:356)
    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
    at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:38)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:748)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld'
    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.startProcess(ExecHandleRunner.java:97)
    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
    ... 7 more
Caused by: java.io.IOException: Cannot run program "/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld" (in directory "/Users/name/Documents/Projects/onlinetrucks_android/MyApplication/app"): error=86, Bad CPU type in executable
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
    ... 10 more
Caused by: java.io.IOException: error=86, Bad CPU type in executable
    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)
    ... 11 more

在执行Gradle Sync时,我得到

warning: Linking two modules of different target triples: /Users/name/Library/Android/sdk/build-tools/28.0.3/renderscript/lib/bc/x86/libclcore.bc' is 'armv7--linux-android' whereas '/Users/name/Documents/Projects/onlinetrucks_android/MyApplication/app/build/generated/res/rs/debug/raw/bc32/singlesource.bc' is 'armv7-none-linux-gnueabi'

Execution failed for task ':app:compileDebugRenderscript'.

启动过程'命令'/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld''出现问题

有没有一种方法可以强迫Android Studio尝试使用库的64位兼容版本?任何帮助将不胜感激,因为该项目的很大一部分取决于Renderscript。

补充笔记:

  1. 我在此项目中未使用androidX,因为它会弄乱renderscript,然后导致它与Google Play的64位要求不兼容。

  2. 我的gradle文件中的renderscript部分如下所示:

    renderscriptTargetApi 22
    renderscriptSupportModeEnabled true

Answers:


5

对于有相同问题的任何人,这都是一个错误。使用渲染脚本时,链接器使用32位文件。已记录多个错误。如果您想跟踪,可以跟踪此处发生的情况:https : //issuetracker.google.com/issues/142590626

抱着大拇指,他们很快就解决了!

更新:他们已在最新的buildtools版本29.0.3中修复了它。您还需要更新到Android Studio 3.6才能使用它。

奖励:对于尝试更新至AndroidX AS WELL的其他人-Renderscript可能会在Android6上中断。有一种解决方法(据我所知),您在哪里将renderscriptSupportModeEnabled设置为false-但这并不能解决所有设备的问题(例如Xiomi Redmi go-Android 8.1-然后对我不利)。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.